O'Reilly logo

Mastering Joomla! 1.5 Extension and Framework Development by Chuck Lanham, James Kennard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the registry

Joomla! provides us with the class JRegistry; this class enables us to store and retrieve data using namespaces. Data stored in a JRegistry object is organized using a hierarchy based on namespaces.

Namespaces are unique hierarchical tree identifiers used to categorize data. Imagine we want to store the number of sightings of animals in an area. We could use the following hierarchy:

animal
animal.total
animal.bird
animal.bird.chaffinch
animal.bird.swan
animal.mammal
animal.mammal.badger
animal.mammal.squirrel.red
animal.mammal.squirrel.grey

Based on this example, if we wanted to know how many badgers we have sighted, we would retrieve the value using the registry path animal.mammal.badger. If we wanted to know how many mammals ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required