What is $# variables

Author Message

Fox Mulder

Friday 14 September 2007 1:18:16 am

Hello,

I meet this kind of variable $#collection_attributes ... what is the sign # and what is it's purpose?

Olivier Ouin

Friday 14 September 2007 1:33:51 am

This is for global variables.

Fox Mulder

Friday 14 September 2007 1:57:43 am

10x very much

André R.

Friday 14 September 2007 2:07:41 am

This is scope of the variable, documentation on it can be found in the old doc:
http://ez.no/ezpublish/documentation/reference/template_functions/variables/set_block

Also a lot of comments about it in the new doc:
http://ez.no/doc/ez_publish/technical_manual/3_9/reference/template_functions/variables/set#comment14285
http://ez.no/doc/ez_publish/technical_manual/3_9/reference/template_functions/variables/set_block#comment14300

root scope: $:variable
global scope: $#variable

Namespaces in variables:
with root scope: $YourNameSpace:variable

But it's not used to much any more other then in set-blocks when you want to set global variables like cache_ttl (view cache timeout) and persistant_variable ( a variable that is cache safe to send from node templates to pagelayout)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Olivier Ouin

Friday 14 September 2007 2:52:16 am

You can frequently find this syntax in datatypes standard templates for collect view too, for retrieving collected data.

Pedro Lopez

Friday 08 August 2008 2:29:45 pm

global variables.

Pedro R. Lopes
http://madurosfritos.blogspot.com

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 18 2025 18:33:20
Script start
Timing: Jan 18 2025 18:33:20
Module start 'layout'
Timing: Jan 18 2025 18:33:20
Module start 'content'
Timing: Jan 18 2025 18:33:21
Module end 'content'
Timing: Jan 18 2025 18:33:21
Script end

Main resources:

Total runtime0.7950 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.7969152.6094
Module start 'layout' 0.00550.0034 740.406339.4297
Module start 'content' 0.00890.7848 779.8359634.8125
Module end 'content' 0.79370.0013 1,414.648412.1875
Script end 0.7950  1,426.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4197160.0002
Check MTime0.00140.1771160.0001
Mysql Total
Database connection0.00080.100410.0008
Mysqli_queries0.742593.3969700.0106
Looping result0.00070.0899680.0000
Template Total0.766396.420.3832
Template load0.00200.249220.0010
Template processing0.764396.142220.3822
Template load and register function0.00030.032610.0003
states
state_id_array0.00070.093710.0007
state_identifier_array0.00090.111420.0004
Override
Cache load0.00160.2040270.0001
Sytem overhead
Fetch class attribute can translate value0.00070.088040.0002
Fetch class attribute name0.00180.220770.0003
XML
Image XML parsing0.00090.112240.0002
class_abstraction
Instantiating content class attribute0.00010.009070.0000
General
dbfile0.00080.0961170.0000
String conversion0.00000.001440.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/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
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs