7.2. Opt_View class
7.2.29. setFormatGlobal()
7.2.28. setFormat()
« Previous
7.2.30. setTemplate()
Next »

7.2.29. setFormatGlobal()

ConstructStatic method
Visibilitypublic
Referencevoid setFormatGlobal( string $item, string $format [, boolean $global = true ] )

Sets the format to the global template item $name. To get to know more about data formats in OPT, see a chapter about data formats.

Opt_View::setFormatGlobal() in fact provides a nice, object-independent wrapper to specify the global variable format without the need of having an Opt_View object. The following two lines are equivalent:

$view->setFormat('global.variable', 'Objective');
Opt_View::setFormatGlobal('variable', 'Objective');

If the $global argument is false, the method does not prepend global. string to the registered item. It can be used to specify the data format of the local variable in all the views, instead of one. Note that a particular view can overwrite this format with setFormat().

The $global attribute is available since OPT 2.0.1.

See also:

7.2.29. setFormatGlobal()
7.2. Opt_View class
« Previous
7.2.28. setFormat()
Next »
7.2.30. setTemplate()