SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 233 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

mammal.
A drawback of using this type of hierarchy is that data items can only
be stored in one path. This can be difficult if the location of a data item
is ambiguous.
The main purpose of this class in Joomla! is to store global configuration options.
There is a global JRegistry object, referred to as the registry or config. We can
access this object via JFactory; this example demonstrates how we get a reference to
the object:
$registry =& JFactory::getConfig();
There are two important methods, getValue() and setValue(), which function as
accessors and modifiers for registry data. This example demonstrates how we can
increment the value foo.bar in the registry using these methods:
$registry =& JFactory::getConfig();
$oldValue = $registry->getValue('foo.bar', 0);
$registry->setValue('foo.bar', ++$oldValue);
Chapter 7
[ 175 ]
When we populate the $oldValue variable using the getValue() method we supply
a second parameter. This is the default value to return if no value currently exists,
and this parameter is optional.


Pages:
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
druga wojna światowa Free English grammar and study guid hotel jelenia góra Russian bride counter strike 1.6