本文整理匯總了PHP中JModuleHelper::includePaths方法的典型用法代碼示例。如果您正苦於以下問題:PHP JModuleHelper::includePaths方法的具體用法?PHP JModuleHelper::includePaths怎麽用?PHP JModuleHelper::includePaths使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JModuleHelper
的用法示例。
在下文中一共展示了JModuleHelper::includePaths方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addIncludePath
/**
* Add a directory where JModuleHelper should search for module. You may
* either pass a string or an array of directories.
*
* @param string $path A path to search.
*
* @return array An array with directory elements
*
* @since 11.1
*/
public static function addIncludePath($path = '')
{
// Force path to array
settype($path, 'array');
// Loop through the path directories
foreach ($path as $dir) {
if (!empty($dir) && !in_array($dir, self::$includePaths)) {
jimport('joomla.filesystem.path');
array_unshift(self::$includePaths, JPath::clean($dir));
//fix to override include path priority
self::$includePaths = array_reverse(self::$includePaths);
}
}
return self::$includePaths;
}