当前位置: 首页>>代码示例>>PHP>>正文


PHP Env::getControllerClass方法代码示例

本文整理汇总了PHP中Env::getControllerClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Env::getControllerClass方法的具体用法?PHP Env::getControllerClass怎么用?PHP Env::getControllerClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Env的用法示例。


在下文中一共展示了Env::getControllerClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: useController

	/**
	 * Find and include specific controller based on controller name
	 *
	 * @access public
	 * @param string $controller_name
	 * @return boolean
	 * @throws FileDnxError if controller file does not exists
	 * 
	 */
	static function useController($controller_name) {
		$controller_class = Env::getControllerClass($controller_name);
		
		// Search For Plugin. Execute it if found
		$plugins = Plugins::instance()->getActive() ;
		$pluginName = null ; 
		foreach ($plugins as $plugin) {
			/* @var $plugin Plugin  */
			$systemName = $plugin->getSystemName() ;
			//$controller_file = ROOT."/plugins/$pluginName/application/controllers/$controller_class.class.php";
			$controller_file = $plugin->getControllerPath()."$controller_class.class.php";
			//echo $controller_file ."<br/>";
			if (is_file($controller_file)){
				$pluginName = $plugin ;
				Plugins::instance()->setCurrent($plugin) ;
				include_once $controller_file;
				return true ;
			}
		}
		
		
		// Plugin not found - Search for core controller
		
		
		if(class_exists($controller_class, false)) return true;

		$controller_file = APPLICATION_PATH . "/controllers/$controller_class.class.php";
		if(is_file($controller_file)) {
			include_once $controller_file;
			return true;
		} else {
			throw new FileDnxError($controller_file, "Controller '$controller_name' does not exists (expected location '$controller_file')");
		} // if
	} // useController
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:43,代码来源:Env.class.php

示例2: useController

 /**
  * Find and include specific controller based on controller name
  *
  * @access public
  * @param string $controller_name
  * @return boolean
  * @throws FileDnxError if controller file does not exists
  */
 static function useController($controller_name)
 {
     $controller_class = Env::getControllerClass($controller_name);
     if (class_exists($controller_class, false)) {
         return true;
     }
     $controller_file = APPLICATION_PATH . "/controllers/{$controller_class}.class.php";
     if (is_file($controller_file)) {
         include_once $controller_file;
         return true;
     } else {
         throw new FileDnxError($controller_file, "Controller '{$controller_name}' does not exists (expected location '{$controller_file}')");
     }
     // if
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:23,代码来源:Env.class.php

示例3: getControllerPath

 /**
  * Get Controller File Path, looks for controller file and returns the path 
  *
  * @access public
  * @param string $controller_name
  * @return boolean
  * @throws FileDnxError if controller file does not exists
  */
 static function getControllerPath($controller_name)
 {
     trace(__FILE__, "getControllerPath({$controller_name})");
     $controller_class = Env::getControllerClass($controller_name);
     $controller_file = APPLICATION_PATH . "/controllers/{$controller_class}.class.php";
     trace(__FILE__, "getControllerPath({$controller_name}) - core: {$controller_file}");
     $controller_file_plugin = APPLICATION_PATH . "/plugins/{$controller_name}/controllers/{$controller_class}.class.php";
     trace(__FILE__, "getControllerPath({$controller_name}) - plugin: {$controller_file_plugin}");
     if (is_file($controller_file)) {
         return $controller_file;
     } else {
         if (is_file($controller_file_plugin)) {
             return $controller_file_plugin;
         } else {
             throw new FileDnxError($controller_file, "Controller '{$controller_name}' does not exists (expected location '{$controller_file}' or '{$controller_file_plugin}')");
         }
     }
 }
开发者ID:federosky,项目名称:ProjectPier-Core,代码行数:26,代码来源:Env.class.php

示例4: getControllerPath

 /**
 * Get Controller File Path, looks for controller file and returns the path 
 *
 * @access public
 * @param string $controller_name
 * @return boolean
 * @throws FileDnxError if controller file does not exists
 */
 static function getControllerPath($controller_name) {
   trace(__FILE__,"getControllerPath($controller_name)");
   $controller_class = Env::getControllerClass($controller_name);
   $controller_file = APPLICATION_PATH . "/controllers/$controller_class.class.php";
   trace(__FILE__,"getControllerPath($controller_name) - core: $controller_file");
   $controller_file_plugin = APPLICATION_PATH . "/plugins/$controller_name/controllers/$controller_class.class.php";
   trace(__FILE__,"getControllerPath($controller_name) - plugin: $controller_file_plugin");
   if (is_file($controller_file)) return $controller_file;
   else if (is_file($controller_file_plugin)) return $controller_file_plugin;
   else throw new FileDnxError($controller_file, "Controller '$controller_name' does not exists (expected location '$controller_file' or '$controller_file_plugin')");
 } // getControllerFilePath
开发者ID:rjv,项目名称:Project-Pier,代码行数:19,代码来源:Env.class.php


注:本文中的Env::getControllerClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。