本文整理匯總了PHP中Vtiger_Loader::includeOnce方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Loader::includeOnce方法的具體用法?PHP Vtiger_Loader::includeOnce怎麽用?PHP Vtiger_Loader::includeOnce使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vtiger_Loader
的用法示例。
在下文中一共展示了Vtiger_Loader::includeOnce方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: autoLoad
/**
* Function to auto load the required class files matching the directory pattern modules/xyz/types/Abc.php for class xyz_Abc_Type
* @param <String> $className
* @return <Boolean>
*/
public static function autoLoad($className)
{
$parts = explode('_', $className);
$noOfParts = count($parts);
if ($noOfParts > 2) {
$filePath = 'modules.';
// Append modules and sub modules names to the path
for ($i = 0; $i < $noOfParts - 2; ++$i) {
$filePath .= $parts[$i] . '.';
}
$fileName = $parts[$noOfParts - 2];
$fileComponentName = strtolower($parts[$noOfParts - 1]) . 's';
$filePath .= $fileComponentName . '.' . $fileName;
return Vtiger_Loader::includeOnce($filePath);
}
return false;
}
示例2: autoLoad
/**
* Function to auto load the required class files matching the directory pattern modules/xyz/types/Abc.php for class xyz_Abc_Type
* @param <String> $className
* @return <Boolean>
*/
public static function autoLoad($className)
{
$parts = explode('_', $className);
$noOfParts = count($parts);
if ($noOfParts > 2) {
foreach (self::$loaderDirs as $filePath) {
// Append modules and sub modules names to the path
for ($i = 0; $i < $noOfParts - 2; ++$i) {
$filePath .= $parts[$i] . '.';
}
$fileName = $parts[$noOfParts - 2];
$fileComponentName = strtolower($parts[$noOfParts - 1]) . 's';
$filePath .= $fileComponentName . '.' . $fileName;
if (file_exists(self::resolveNameToPath($filePath))) {
return Vtiger_Loader::includeOnce($filePath);
}
}
}
return false;
}