Actions

Difference between revisions of "Jimport"

From Joomla! Documentation

m (I correct the name of the file in the second example)
m (updated link to API docs)
 
Line 1: Line 1:
The joomla function jimport($path) [http://api.joomla.org/Joomla-Framework/_loader.php.html#functionjimport (See API)] is a core function used to load joomla library files.
+
The joomla function jimport($path) [http://api.joomla.org/1.5/Joomla-Framework/_loader.php.html#functionjimport (See API)] is a core function used to load joomla library files.
  
  

Latest revision as of 18:05, 31 October 2012

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
{
...