设置目录树及图标
@param $actions
@return mixed
506661
protected function setIcon($actions, $num = 1)
    {
        foreach ($actions as $key=>$moudel){
            if(isset($moudel['actions'])){
                $actions[$key]['iconClose'] = $this->request->root()."/apidoc/js/zTree_v3/img/zt-folder.png";
                $actions[$key]['iconOpen'] = $this->request->root()."/apidoc/js/zTree_v3/img/zt-folder-o.png";
                $actions[$key]['open'] = true;
                $actions[$key]['isParent'] = true;
                $actions[$key]['actions'] = $this->setIcon($moudel['actions'], $num = 1);
            }else{
                $actions[$key]['icon'] = $this->request->root()."/apidoc/js/zTree_v3/img/zt-file.png";
                $actions[$key]['isParent'] = false;
                $actions[$key]['isText'] = true;
            }
        }
        return $actions;
    }
126271
public function action($action)
    {
        $a = func_get_args();
        $controllerPath = $this->controller->getControllerActionPath();
        array_unshift($a, $controllerPath);
        $ret = call_user_func_array([$this, 'url'], $a);

        return $ret;
    }
1218179
protected function getActionsFileManager()
    {
        $commands = $this->command->getHandlers();

        foreach ($commands as $command_id => $command) {
            if (empty($command['multiple'])) {
                unset($commands[$command_id]);
            }
        }

        return $commands;
    }
93218
public function getByAction($action)
	{
		return isset($this->actionList[$action]) ? $this->actionList[$action] : null;
	}
1140987
public function fromArray(array $actions)
    {
        foreach ($actions as $action => $arguments) {
            $this->addAction($action, $arguments);
        }
        return $this;
    }
826067
protected function findMiddleware($action)
    {
        if (is_array($action) && isset($action['_middleware'])) {
            return $action['_middleware'];
        } elseif (isset($this->group['_middleware'])) {
            return $this->group['_middleware'];
        }

        return false;
    }
1207688
public function addActions(array $actions): self
    {
        foreach ($actions as $action) {
            $this->addAction($action);
        }

        return $this;
    }
312695
public function set($actions)
    {
        if (! is_array($actions)) {
            $actions = func_get_args();
        }

        $this->clear();

        foreach ($actions as $action) {
            $this->push($action);
        }

        return $this->getDisplay();
    }
1160156
protected function formatAction($action)
    {
        if ($this->rootNamespace && ! (strpos($action, '\\') === 0)) {
            return $this->rootNamespace.'\\'.$action;
        } else {
            return trim($action, '\\');
        }
    }
172989
public static function make($actions)
    {
        $instance = new static();
        if (array_key_exists(
            'before',
            $actions
        )) {
            $before = !is_array($actions['before']) ? [$actions['before']] : $actions['before'];
            foreach (array_values($before) as $format) {
                $instance->addBefore(DinamycFunction::make($format));
            }
        }

        if (array_key_exists(
            'after',
            $actions
        )) {
            $after = !is_array($actions['after']) ? [$actions['after']] : $actions['after'];
            foreach (array_values($after) as $format) {
                $instance->addAfter(DinamycFunction::make($format));
            }
        }

        return $instance;
    }
786104
public function filter($action = 'set') {
        $role = $this->Roles->newEntity();
        if ($this->request->session()->check('Roles')) {
            $session = $this->request->session()->read('Roles');
            $role = $this->Roles->patchEntity($role,  $session);
        }
        if ($this->request->is(['patch', 'post', 'put'])) {
            if ($action == 'unset') {
                $this->request->session()->delete('Roles');
            } else {
                $this->request->session()->write('Roles', $this->request->data);
            }
            $this->Flash->success(__('The role has been saved.'));
            return $this->redirect(['action' => 'index']);
        }
        $this->set(compact('role'));
        $this->set('_serialize', ['role']);
    }
738516
protected function actionReferencesController($action)
    {
        if ($action instanceof Closure) {
            return false;
        }

        return is_string($action) || is_string(array_get($action, 'uses'));
    }
299686
public function httpAction($action)
    {
        $request     = $this->getRequestData();
        $names       = array_reverse(explode('/', $action));
        $namesLength = count($names);
        for ($i = 1; $i < $namesLength; $i++) {
            $names[ $i ][0] = strtoupper($names[ $i ][0]);
        }
        $action     = implode($names);
        $methodName = preg_replace('/[^a-z]+/si', null, $action) . 'Action';
        $result     = $this->{$methodName}($request);

        if (is_array($result)) {
            $serializer = new JsonSerializer();
            $responseBody = $serializer->serialize($result);
            $result     = new Response($responseBody, 200, array('Content-Type' => 'application/json'));
        }

        return $result;
    }
1125097
public function moduleForAction($action)
    {
        if (!isset($this->actions[$action])) {
            return null;
        }

        return $this->modules[$this->actions[$action]];
    }
711575
public function addActions(array $actions)
    {
        collect($actions)->each(function ($action) {
            $this->addAction($action);
        });

        return $this;
    }
796997
public static function make($actions)
    {
        $instance = new static();

        if (array_key_exists(
            'whenInsert',
            $actions
        )) {
            $instance->setWhenInsert(ActionEntry::make($actions['whenInsert']));
        }

        if (array_key_exists(
            'whenUpdate',
            $actions
        )) {
            $instance->setWhenUpdate(ActionEntry::make($actions['whenUpdate']));
        }

        if (array_key_exists(
            'whenDelete',
            $actions
        )) {
            $instance->setWhenDelete(ActionEntry::make($actions['whenDelete']));
        }

        return $instance;
    }
325440
protected function getActionPath(string $action): string
    {
        $modelName = $this->getModelName();
        $viewName  = $modelName.ucfirst($action).'.js';

        return resource_path('assets/admin/src/views/'.pluralize($modelName).'/'.$viewName);
    }