當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。