本文整理匯總了PHP中pc_base::my_path方法的典型用法代碼示例。如果您正苦於以下問題:PHP pc_base::my_path方法的具體用法?PHP pc_base::my_path怎麽用?PHP pc_base::my_path使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pc_base
的用法示例。
在下文中一共展示了pc_base::my_path方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: load_controller
/**
* 加載控製器
* @param string $filename
* @param string $m
* @return obj
*/
private function load_controller($filename = '', $m = '')
{
if (empty($filename)) {
$filename = ROUTE_C;
}
if (empty($m)) {
$m = ROUTE_M;
}
$filepath = PC_PATH . 'modules' . DIRECTORY_SEPARATOR . $m . DIRECTORY_SEPARATOR . $filename . '.php';
if (file_exists($filepath)) {
$classname = $filename;
include $filepath;
if ($mypath = pc_base::my_path($filepath)) {
$classname = 'MY_' . $filename;
include $mypath;
}
if (class_exists($classname)) {
return new $classname();
} else {
exit('Controller does not exist.');
}
} else {
exit('Controller does not exist.');
}
}
示例2: load_controller
/**
* 加載插件控製器
* @param string $filename
* @param string $m
* @return obj
*/
private function load_controller($filename = '', $m = '') {
if (empty($filename)) $filename = PLUGIN_FILE;
if (empty($m)) $m = PLUGIN_ID;
$filepath = PC_PATH.'plugin'.DIRECTORY_SEPARATOR.$m.DIRECTORY_SEPARATOR.$filename.'.class.php';
if (file_exists($filepath) && $filename !='plugin_admin') {
$classname = $filename;
include $filepath;
if ($mypath = pc_base::my_path($filepath)) {
$classname = 'MY_'.$filename;
include $mypath;
}
return new $classname;
} else {
exit(L('plugin_error_or_not_exist','','plugin'));
}
}