references:joomla.framework:application:jcontroller-_setpath_setPath
Sets an entire array of search paths for resources. The default directories are always added as a last resort for searches. The existing array is cleared, the default path is added and then the specified paths are added. This method is protected and should only be invoked by methods of derived classes. Syntaxvoid _setPath ( $type, $path )
ExamplesExample $viewPaths = array( '/var/www/trunk/administrator/components/com_weblinks/otherviews/', '/var/www/trunk/administrator/components/com_weblinks/moreviews/' ); $controller = new JController(); print_r( $controller->_path ); $controller->_setPath( 'view', $viewPaths ); 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/moreviews/ [1] => /var/www/trunk/administrator/components/com_weblinks/otherviews/ [2] => /var/www/trunk/administrator/components/com_weblinks/views/ ) ) |


