references:joomla.framework:application:jcontroller-addmodelpathTable of Contents
addModelPath
Adds to the stack of controller model paths in LIFO order. This method will invoke the protected JController::_addPath() method to add to the list of directories which are searched for models. Syntaxvoid addModelPath ( $path )
ExamplesExample jimport( 'joomla.application.component.controller' ); $controller = new JController(); print_r( $controller->_path ); $controller->addModelPath( JPATH_COMPONENT .DS. 'othermodels' ); print_r( $controller->_path ); might produce (note that the _path property is private and should not be used by third party applications. It is used here only for demonstration purposes) Result Array ( [model] => Array ( [0] => /var/www/trunk/components/com_prodigo/models/ ) [view] => Array ( [0] => /var/www/trunk/components/com_prodigo/views/ ) ) Array ( [model] => Array ( [0] => /var/www/trunk/components/com_prodigo/othermodels/ [1] => /var/www/trunk/components/com_prodigo/models/ ) [view] => Array ( [0] => /var/www/trunk/components/com_prodigo/views/ ) ) |


