Actions

Jimport

From Joomla! Documentation

Revision as of 18:05, 31 October 2012 by HobbesPDX (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The joomla function jimport($path) (See API) is a core function used to load joomla library files.


How it works (short version)

The dots (.) in $path are replaced with a directory separator ("/" or "\") and ".php" extension is added at the end of the string. This path is included.

Examples of use

jimport('joomla.application.component.controller');

- will include the php file "/libraries/joomla/application/component/controller.php". This file holds the class JController.


jimport('joomla.application.component.model');

- will include the php file "/libraries/joomla/application/component/model.php". This file holds the class JModel.


jimport('joomla.application.component.view'); // Includes JView
class RecipeViewIngredients extends JView
{
...