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


PHP CController::createAction方法代码示例

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


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

示例1: createAction

 public function createAction($actionID)
 {
     $action = parent::createAction($actionID);
     if ($action !== null) {
         return $action;
     }
     foreach ($this->_behaviorIDs as $behaviorID) {
         $object = $this->asa($behaviorID);
         if ($object->getEnabled() && method_exists($object, 'action' . $actionID)) {
             return new CInlineAction($object, $actionID);
         }
     }
 }
开发者ID:imanifaiz,项目名称:angular-music-db,代码行数:13,代码来源:BaseController.php

示例2: createAction

 /**
  * This overrides the default behaviour for supported resources by pushing the resource
  * into the GET parameter and updating the actionID.
  *
  * This is necessary because there's no way of pushing the appropriate pattern to the top of the
  * URLManager config, so this captures calls where the id doesn't contain non-numerics.
  *
  * @param string $actionID
  *
  * @return \CAction|\CInlineAction
  */
 public function createAction($actionID)
 {
     if (in_array($actionID, static::$resources)) {
         $_GET['resource_type'] = $actionID;
         switch (\Yii::app()->getRequest()->getRequestType()) {
             case 'PUT':
                 return parent::createAction('Update');
                 break;
             case 'DELETE':
                 return parent::createAction('Delete');
                 break;
             default:
                 $this->sendResponse(405);
                 break;
         }
     }
     return parent::createAction($actionID);
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:29,代码来源:V1Controller.php

示例3: createActionInstances

 /**
  * Creates the action instances for the given controller
  * @param \CController $controller the controller to get actions for
  *
  * @return \CAction[] the controller actions
  */
 protected function createActionInstances(\CController $controller)
 {
     $actions = array();
     foreach ($controller->actions() as $id => $config) {
         $actions[$id] = $controller->createAction($id);
     }
     $reflector = new \ReflectionObject($controller);
     foreach ($reflector->getMethods() as $name => $method) {
         if ($name != 'actions' && substr($name, 0, 6) == 'action') {
             $id = lcfirst(substr($name, 6));
             $actions[$id] = $controller->createAction($id);
         }
     }
     return $actions;
 }
开发者ID:codemix,项目名称:restyii,代码行数:21,代码来源:Schema.php

示例4: createAction

 /**
  * Creates the action instance based on the action name.
  * Additionally, this implementing checks attached behaviors for actions.
  */
 public function createAction($actionID)
 {
     $action = parent::createAction($actionID);
     // search in behaviors
     if ($action === null) {
         foreach ($this->behaviors() as $behavior => $data) {
             $behavior = $this->{$behavior};
             if (is_subclass_of($behavior, 'IBehavior') && method_exists($behavior, 'action' . $actionID)) {
                 return new CInlineAction($behavior, $actionID);
             }
         }
     }
     return $action;
 }
开发者ID:hansenmakangiras,项目名称:disperindag,代码行数:18,代码来源:EController.php


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