Joomla Object Model

  • PDF

Object Model

The Joomla framework is object oriented code implemented with a base class called JApplication.  For an illustration and more background  see:

http://docs.joomla.org/Framework

For more information about the framework you can refer to the api documentation.  This documentation is generated automatically from the exisiting code and is found at:

http://api.joomla.org/

Some examples of the framework in action include:

1) Retrieving Template information:

<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/<?php echo $this->params->get('colorVariation'); ?>.css" type="text/css" />

$this is an instance of the JDocument class.  So $this->baseurl finds the base URL for the index file.

$this->params is an instance of the JParameter class.

2) Counting Modules

Frequently a template will have code that will eliminate a colomn if there is no module.  The example here:

http://docs.joomla.org/Counting_modules_in_multiple_module_positions

illustrates a method using the function countModules.