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.