| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Application |
JController |
_addPath |
_addPath() |
Never | Work in Progress |
Adds to the search path for models and views.
This method is protected and should only be called by methods in classes derived from JController.
void _addPath ( $type, $path )
| $type | string | The path type (e.g. ‘model’, ‘view’. |
| $path | mixed | is either a string containing the path to be added to the search list or an array of strings containing paths to be added. |
Example
$controller = new JController(); print_r( $controller->_path ); $controller->_addPath( 'view', JPATH_COMPONENT .DS. 'otherviews' ); print_r( $controller->_path );
might produce (note that neither _addPath or _path should not be accessed directly and are only used here for demonstration purposes)
Result
Array ( [model] => Array ( [0] => /var/www/trunk/administrator/components/com_weblinks/models/ ) [view] => Array ( [0] => /var/www/trunk/administrator/components/com_weblinks/views/ ) ) Array ( [model] => Array ( [0] => /var/www/trunk/administrator/components/com_weblinks/models/ ) [view] => Array ( [0] => /var/www/trunk/administrator/components/com_weblinks/otherviews/ [1] => /var/www/trunk/administrator/components/com_weblinks/views/ ) )