Setting global variables

Author Message

Rami Grossman

Friday 22 October 2004 7:37:34 am

I need to set a global variable as an array. So I could access it from any place.
I used to write set-block with scope=root, but it can't be set as an array.

thanks
Rami

Ɓukasz Serwatka

Saturday 23 October 2004 1:31:59 pm

Hi

Did you try this?

{set-block name=<name> scope=global variable=<myvariable>}

{array(1,2,3,4)} or

{hash('key', 'value')}

{/set-block}

I hope this help

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Rami Grossman

Sunday 24 October 2004 1:06:02 am

but set-block is used only to pass text input as a variable. It is not logical that ez crew didn't think about using global variables not only as text input!?!?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 00:16:46
Script start
Timing: Jan 19 2025 00:16:46
Module start 'layout'
Timing: Jan 19 2025 00:16:46
Module start 'content'
Timing: Jan 19 2025 00:16:47
Module end 'content'
Timing: Jan 19 2025 00:16:47
Script end

Main resources:

Total runtime0.7559 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9063152.6250
Module start 'layout' 0.00540.0027 740.531339.4297
Module start 'content' 0.00820.7460 779.9609534.8594
Module end 'content' 0.75420.0016 1,314.82038.1797
Script end 0.7558  1,323.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4191160.0002
Check MTime0.00120.1632160.0001
Mysql Total
Database connection0.00080.108910.0008
Mysqli_queries0.709493.8503570.0124
Looping result0.00050.0606550.0000
Template Total0.726296.120.3631
Template load0.00210.284420.0011
Template processing0.724095.787220.3620
Template load and register function0.00030.040410.0003
states
state_id_array0.00070.086310.0007
state_identifier_array0.00110.141820.0005
Override
Cache load0.00180.2323150.0001
Sytem overhead
Fetch class attribute can translate value0.00080.106820.0004
Fetch class attribute name0.00110.147640.0003
XML
Image XML parsing0.00090.118320.0004
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00150.1942180.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs