Source code for file /pattemplate/patTemplate/Function/Globalvar.php
Documentation is available at Globalvar.php
* patTemplate function that enables adding global variables
* from within a template.
* $Id: Globalvar.php 221 2004-05-28 15:45:08Z schst $
// Check to ensure this file is within the rest of the framework
* patTemplate function that enables adding global variables
* from within a template.
* name > name of the variable
* default > default value of the variable
* hidden > whether to output the content of the variable: yes|no
* $Id: Globalvar.php 221 2004-05-28 15:45:08Z schst $
* reference to the patTemplate object that instantiated the module
* set a reference to the patTemplate object that instantiated the reader
* @param object patTemplate object
* @param array parameters of the function (= attributes of the tag)
* @param string content of the tag
* @return string content to insert into the template
function call( $params, $content )
if( isset
( $params['default'] ) )
$this->_tmpl->addGlobalVar( $params['name'], $params['default'] );
if( !isset
( $params['hidden'] ) )
$params['hidden'] =
'no';
if( $params['hidden'] !=
'yes' )
return $this->_tmpl->getOption('startTag').
strtoupper($params['name']).
$this->_tmpl->getOption('endTag');