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


PHP Zend_Controller_Action::__call方法代码示例

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


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

示例1: __call

 /**
  * Proxy calls to undefined methods to getHelper()->direct()
  * 
  * 
  * @param string $method
  * @param array $params
  * @return mixed
  */
 public function __call($method, $params)
 {
     if (substr($method, -6) !== 'Action') {
         $helper = $this->_helper->getHelper($method);
         return call_user_func_array(array($helper, 'direct'), $params);
     }
     return parent::__call($method, $params);
 }
开发者ID:JurJean,项目名称:waf-model,代码行数:16,代码来源:Action.php

示例2: preDispatch

 public function preDispatch()
 {
     parent::preDispatch();
     $request = $this->getRequest();
     parent::__call($request->getActionName(), array());
     if (!$this->checkActionAccess($request->getControllerName(), $request->getActionName())) {
         throw new Rabotal_Exception_Access('Access denied!', 403);
     }
 }
开发者ID:romikring,项目名称:rcalex,代码行数:9,代码来源:Action.php

示例3: __call

 /**
  * Map an unknown call to the delegate manager
  *
  * @todo A flag to prevent recursive action loops?
  * @param string $name
  * @param array $args
  * @return mixed Return value of the delegated action
  */
 public function __call($name, $args)
 {
     if (substr(strtolower($name), -6) !== 'action') {
         return parent::__call($name, $args);
     } else {
         $manager = $this->_getDelegateManager();
         return $manager->run($name, $args);
     }
 }
开发者ID:rosstuck,项目名称:trifle,代码行数:17,代码来源:ControllerAbstract.php

示例4: __call

 public function __call($method, $args = array())
 {
     // Proxy externals for
     if ('externalsAction' == $method) {
         $path = APPLICATION_PATH . '/application/libraries/Adminer';
         list($base, $static) = explode('externals', $_SERVER['REQUEST_URI']);
         $this->_outputFile($path . '/externals' . $static);
         exit;
     }
     parent::__call($methodName, $args);
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:11,代码来源:ToolsController.php

示例5: __call

 public function __call($method, $args)
 {
     $arr = null;
     if (!preg_match('/^(.+)Action$/', $method, $arr)) {
         return parent::__call($method, $args);
     }
     $class = $arr[1];
     $actionController = new $class();
     if ($actionController && $actionController instanceof KalturaAdminConsolePlugin) {
         $actionController->action($this);
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:PluginController.php

示例6: __call

 public function __call($method, $args)
 {
     KalturaLog::debug("Called method [{$method}] with args [" . print_r($args, true) . "]");
     $arr = null;
     if (!preg_match('/^(.+)Action$/', $method, $arr)) {
         return parent::__call($method, $args);
     }
     $class = $arr[1];
     $actionController = new $class();
     if ($actionController && $actionController instanceof KalturaApplicationPlugin) {
         $actionController->action($this);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:13,代码来源:PluginController.php

示例7: __call

 public function __call($methodName, $args)
 {
     if (preg_match('~^(.*)Action$~', $methodName, $m)) {
         $action_name = $m[1];
         if (preg_match('~^(.*)(' . $this->_suffixes() . ')$~', $action_name, $m)) {
             $action_name = $m[1];
             $handler = $m[2];
         } else {
             $handler = 'run';
         }
         $capitaized_action_name = ucfirst(strtolower($action_name));
         $cn = $this->controller_name($this);
         $cd = $this->controller_dir();
         $action_class_path = $cd . $cn . DIRECTORY_SEPARATOR . $capitaized_action_name . 'Action.php';
         if (file_exists($action_class_path)) {
             require_once $action_class_path;
             $action_class = $this->module_name($this) . '_' . $cn . '_' . $capitaized_action_name . 'Action';
             $action = new $action_class($this);
             return $action->{$handler}();
         }
     }
     return parent::__call($methodName, $args);
 }
开发者ID:BGCX262,项目名称:zupal-svn-to-git,代码行数:23,代码来源:Abstract.php

示例8: __call

 /**
  * The router is set to /action and this segment of the url is overloaded
  * so that /someRecipient is also valid.  This __call method is invoked
  * whenever this segment of the url is not a defined action and in these
  * cases, the $actionMethod may be a valid recipient.  These sre trapped
  * here and, if valid, the request is re-dispatched to the index action to
  * which we pass a recipient parameter.
  * If a valid recipient is not found then execution is passed to the  parent
  * __call method.
  *
  * @param string $actionMethod Url segment.
  * @param array  $args         Request arguments.
  *
  * @return null
  */
 public function __call($actionMethod, $args)
 {
     $logger = ESAPI::getAuditor('IndexController');
     // I do not anticipate this happening often...
     if (!is_string($actionMethod)) {
         return parent::__call($actionMethod, $args);
     }
     // If there's less than two recipients defined, we don't need to trap
     // usernames. ignore them.
     if ($this->_recipientsConfig->count() < 2) {
         return parent::__call($actionMethod, $args);
     }
     // Strip the trailing 'Action' from the method name.
     $method = null;
     $detectedCharacterEncoding = mb_detect_encoding($actionMethod);
     $len = mb_strlen($actionMethod, $detectedCharacterEncoding);
     if (mb_substr($actionMethod, $len - 6, 6, $detectedCharacterEncoding) == 'Action') {
         $method = mb_substr($actionMethod, 0, $len - 6, $detectedCharacterEncoding);
     } else {
         $method = $actionMethod;
     }
     // Validate the possible recipient and, if valid, add a 'recipient'
     // request param and continue on to the indexAction of this controller.
     $recipientValidator = new Custom_Validate_ValidRecipient($this->_recipientsConfig);
     if ($recipientValidator->isValid($method)) {
         $this->_request->setActionName('index');
         $this->_request->setParams(array('recipient' => $method, 'action' => 'index'));
         $this->_request->setDispatched(false);
         return;
     }
     return parent::__call($actionMethod, $args);
 }
开发者ID:louiesabado,项目名称:simple-php-contact-form,代码行数:47,代码来源:IndexController.php

示例9: __call

 public function __call($method, $args)
 {
     $retVal = null;
     try {
         $retVal = parent::__call($method, $args);
     } catch (Zend_Controller_Action_Exception $e) {
         list($found, $retVal) = Centurion_Traits_Common::checkTraitOverload($this, $method, $args);
         if (!$found) {
             throw $e;
         }
     }
     return $retVal;
 }
开发者ID:netconstructor,项目名称:Centurion,代码行数:13,代码来源:Action.php

示例10: __call

 public function __call($function, $args)
 {
     $method_name = '_' . $function;
     if (in_array($function, $this->_genericActionsEnabled) && method_exists($this, $method_name)) {
         return $this->{$method_name}();
     }
     if (preg_match('/(\\w+)Action\\z/', $function, $matches)) {
         $module = $this->getRequest()->getModuleName();
         $controller = $this->getRequest()->getControllerName();
         $filename = join('/', array($this->getFrontController()->getControllerDirectory($module), $controller, $matches[1] . '.php'));
         $className = ucfirst($controller) . '_' . ucfirst($matches[1]);
         if (file_exists($filename)) {
             require_once $filename;
             $action = new $className($this);
             //$action->dispatch();
             return $action;
         }
     }
     return parent::__call($function, $args);
 }
开发者ID:html,项目名称:PI,代码行数:20,代码来源:ControllerAction.php

示例11: __call

 public function __call($methodName, $args)
 {
     // jeżeli nie używać kolejki kroków
     if (!Base_Controller_Action_Helper_Steps::getUseSteps()) {
         return parent::__call($methodName, $args);
     }
     // jeżeli akcja nie jest akcją inicjującą proces
     if (substr($methodName, -13, 7) != 'Process' || substr($methodName, -6) != 'Action') {
         return parent::__call($methodName, $args);
     }
     $stepsHelper = $this->_helper->getHelper('steps');
     $processName = substr($methodName, 0, -13);
     // jeżeli akcja zamykająca proces, zakończ proces i przekieruj na wyszukiwanie
     if ($processName == 'stop') {
         $ownerAction = $stepsHelper->getOwnerAction();
         $this->_helper->messenger->error("Proces '" . $stepsHelper->getGeneralProcesDesc() . "' został anulowany");
         $stepsHelper->closeStepsQueue();
         $redirector = $this->_helper->getHelper('Redirector');
         $redirector->setExit(true);
         if ($ownerAction === false || !is_array($ownerAction)) {
             $this->_helper->redirector('index', 'index', null, array());
         } else {
             $this->_helper->redirector($ownerAction['action'], $ownerAction['controller'], null, $ownerAction['params']);
         }
         return;
     }
     // jeżeli jesteśmy w kolejce kroków
     if ($stepsHelper->isStepsQueue()) {
         // jeżeli wywołany proces jest innym procesem niż ten w kolejce
         if ($stepsHelper->getGeneralProcessName() != $processName) {
             $stepsHelper->closeStepsQueue();
             $stepsHelper->initNewProcess($processName);
         }
         // jeżeli kolejka kroków nie istnieje
     } else {
         $model = new Process();
         $row = $model->fetchRow($model->select('id')->where('process_name = ? ', $processName));
         if (is_null($row)) {
             return parent::__call($methodName, $args);
         }
         $stepsHelper->initNewProcess($processName);
     }
     $stepsHelper->forwardToActualStep($this->getRequest()->getParams());
 }
开发者ID:knatorski,项目名称:SMS,代码行数:44,代码来源:Action.php


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