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


PHP Action::getFile方法代码示例

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


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

示例1: getChild

 protected function getChild($child, $args = array())
 {
     Logger::info('child: ' . $child);
     $action = new Action($child, $args);
     if (file_exists($action->getFile())) {
         if (!class_exists($action->getClass())) {
             require_once $action->getFile();
         }
         $class = $action->getClass();
         $controller = new $class($this->registry);
         if (method_exists($class, $action->getMethod())) {
             $controller->{$action->getMethod()}($action->getArgs());
             return $controller->output;
         } else {
             trigger_error('Warning: Method ' . $class . '->' . $action->getMethod() . '(' . $action->getArgs() . ') does not exist', E_USER_WARNING);
             return $this->output;
         }
     } else {
         if (isset($this->data['header'])) {
             $this->output .= $this->data['header'];
         }
         if (isset($this->data['footer'])) {
             $this->output .= $this->data['footer'];
         }
         trigger_error('Error: Could not load controller ' . $child . '! (File: ' . $action->getFile() . ')', E_USER_ERROR);
         return $this->output;
     }
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:28,代码来源:controller.php

示例2: index

 /**
  * 
  * @return type
  */
 public function index()
 {
     $action = new Action('payment/paysondirect');
     if (file_exists($action->getFile())) {
         require_once $action->getFile();
         $class = $action->getClass();
         $controller = new $class($this->registry);
         $controller->setInvoice();
         $controller->{$action->getMethod()}($action->getArgs());
         $this->output = $controller->output;
     }
 }
开发者ID:richitorres,项目名称:module-payson-opencart,代码行数:16,代码来源:paysoninvoice.php

示例3: getChild

 protected function getChild($child, $args = array())
 {
     $action = new Action($child, $args);
     if (file_exists($action->getFile())) {
         require_once $action->getFile();
         $class = $action->getClass();
         $controller = new $class($this->registry);
         $controller->{$action->getMethod()}($action->getArgs());
         return $controller->output;
     } else {
         trigger_error('Error: Could not load controller ' . $child . '!');
         exit;
     }
 }
开发者ID:duanhv,项目名称:mdg-shop,代码行数:14,代码来源:controller.php

示例4: hasAction

 protected function hasAction($child, $args = array())
 {
     $action = new Action($child, $args);
     if (file_exists($action->getFile())) {
         require_once $action->getFile();
         $class = $action->getClass();
         $controller = new $class($this->registry);
         if (method_exists($controller, $action->getMethod())) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:Vitronic,项目名称:kaufreund.de,代码行数:16,代码来源:controller.php

示例5: hasAction

 protected function hasAction($child, $args = array())
 {
     $action = new Action($child, $args);
     if (file_exists($action->getFile())) {
         require_once VQMod::modCheck($action->getFile());
         $class = $action->getClass();
         $controller = new $class($this->registry);
         if (method_exists($controller, $action->getMethod())) {
             return true;
         } else {
             return false;
         }
     } else {
         trigger_error('Error: Could not load controller ' . $child . '!');
         exit;
     }
 }
开发者ID:blogfor,项目名称:pcu,代码行数:17,代码来源:vq2-system_engine_controller.php

示例6: getChild

 protected function getChild($child, $args = array())
 {
     $action = new Action($child, $args);
     $file = $action->getFile();
     $class = $action->getClass();
     $method = $action->getMethod();
     //echo $file.'<br/>';
     if (file_exists($file)) {
         require_once $file;
         $controller = new $class($this->registry);
         $controller->{$method}($args);
         return $controller->output;
     } else {
         exit('Error: Could not load controller ' . $child . '!');
     }
 }
开发者ID:myjavawork,项目名称:shcoyee,代码行数:16,代码来源:controller.php

示例7: getChild

 protected function getChild($child, $args = array())
 {
     $action = new Action($child, $args);
     $file = $action->getFile();
     $class = $action->getClass();
     $method = $action->getMethod();
     if (file_exists($file)) {
         require_once $file;
         $controller = new $class($this->registry);
         if (substr($child, 0, 6) == 'module' && isset($args['position'])) {
             $controller->data['module_position'] = $args['position'];
         }
         $controller->{$method}($args);
         return $controller->output;
     } else {
         trigger_error('Error: Could not load controller ' . $child . '!');
         exit;
     }
 }
开发者ID:shetpratiksha,项目名称:Mobilus_SE,代码行数:19,代码来源:controller.php

示例8: execute

 /**
  * @param Action $action
  * @return mixed
  */
 private function execute($action)
 {
     $file = $action->getFile();
     $class = $action->getClass();
     $method = $action->getMethod();
     $args = $action->getArgs();
     if (file_exists($file)) {
         require_once $file;
         $controller = new $class($this->registry, $method);
         if (is_callable(array($controller, $method))) {
             $action = call_user_func_array(array($controller, $method), $args);
         } else {
             $action = $this->error;
             $this->error = '';
         }
     } else {
         $action = $this->error;
         $this->error = '';
     }
     return $action;
 }
开发者ID:ralfeus,项目名称:moomi-daeri.com,代码行数:25,代码来源:front.php

示例9: render

 protected function render($return = FALSE)
 {
     foreach ($this->children as $child) {
         $action = new Action($child);
         $file = $action->getFile();
         $class = $action->getClass();
         $method = $action->getMethod();
         $args = $action->getArgs();
         if (file_exists($file)) {
             require_once $file;
             $controller = new $class($this->registry);
             $controller->index();
             $this->data[$controller->id] = $controller->output;
         } else {
             exit('Error: Could not load controller ' . $child . '!');
         }
     }
     if ($return) {
         return $this->fetch($this->template);
     } else {
         $this->output = $this->fetch($this->template);
     }
 }
开发者ID:vverhun,项目名称:hoho,代码行数:23,代码来源:controller.php

示例10: render

 protected function render($return = false)
 {
     $cache = $this->registry->get('cache');
     $user = $this->registry->get('user');
     if (isset($this->cacheId) && !empty($this->cacheId) && isset($user) && !$user->islogged()) {
         $cached = $cache->get($this->cacheId);
     }
     if (!isset($cached)) {
         foreach ($this->children as $key => $child) {
             $action = new Action($child);
             $file = $action->getFile();
             $class = $action->getClass();
             $method = $action->getMethod();
             $args = $action->getArgs();
             if (file_exists($file)) {
                 require_once $file;
                 $controller = new $class($this->registry);
                 $controller->index($this->widget[$key]);
                 if (!is_numeric($key)) {
                     $this->data[$key . "_hook"] = $key;
                     $this->data[$key . "_code"] = $controller->output;
                 } else {
                     $this->data[$controller->id] = $controller->output;
                 }
             } else {
                 exit('Error: Could not load controller ' . $child . '!');
             }
         }
         if ($return) {
             $r = $this->fetch($this->template);
             if (isset($this->cacheId) && !empty($this->cacheId)) {
                 $cache->set($this->cacheId, $r);
             }
             return $r;
         } else {
             $this->output = $this->fetch($this->template);
         }
     } else {
         if ($return) {
             return $cached;
         } else {
             $this->output = $cached;
         }
     }
 }
开发者ID:josueaponte7,项目名称:necotienda_standalone,代码行数:45,代码来源:controller.php

示例11: getReplace

 public function getReplace()
 {
     if (is_numeric($this->_key)) {
         $depth = ControllerModuleHtmlBlock::getDepth();
         $args = array('html_block_id' => (int) $this->_key, 'depth' => $depth + 1);
         $action = new Action('module/html_block', $args);
         $file = $action->getFile();
         $class = $action->getClass();
         if (file_exists($file)) {
             require_once $file;
             $controller = new $class(app::registry()->get());
             $controller->index($args);
             $this->_replace = $controller->getOutput();
         }
     }
     return $this->_replace;
 }
开发者ID:nellka,项目名称:mebel,代码行数:17,代码来源:html_block.token.php

示例12: loadControllerByRoute

 public function loadControllerByRoute($route)
 {
     $action = new Action($route);
     // copied from front controller to resolve the action controller and return it:
     if (file_exists($action->getFile())) {
         require_once $action->getFile();
         $class = $action->getClass();
         return new $class($this->registry);
     }
     throw new Exception("Controller doesn't exist!");
 }
开发者ID:sbushinskii,项目名称:opencart-test-suite,代码行数:11,代码来源:OpenCartTest.php


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