@param       $name
@param       $controller
@param       $action
@param array $options

@return bool
183262
protected function setResourceShow($name, $controller, $action, $options = [])
    {
        return $this->mapResource('get', $name . '/(\d+)', $controller, 'get' . ucfirst($action), true);
    }
1112298
public function tab($name, array $options = [])
    {
        if (!isset($options['label'])) {
            $options['label'] = 'form.tab_' . $name;
        }

        return parent::tab($name, $options);
    }
374754
public function filter($name, array $options = [])
    {
        if (static::EXT_FILTER === parent::filter($name, $options) and isset($this->filters[$name])) {
            $filter = new $this->filters[$name]($this, $options);

            $filterResults = $filter->run();

            if (!empty($filterResults)) {
                $this->commands = array_merge($this->commands, (array)$filterResults);
            }
        }
    }
804476
public function controller($uri, $controller, $names = array())
	{
		$prepended = $controller;

		// First, we will check to see if a controller prefix has been registered in
		// the route group. If it has, we will need to prefix it before trying to
		// reflect into the class instance and pull out the method for routing.
		if (count($this->groupStack) > 0)
		{
			$prepended = $this->prependGroupUses($controller);
		}

		$routable = $this->getInspector()->getRoutable($prepended, $uri);

		// When a controller is routed using this method, we use Reflection to parse
		// out all of the routable methods for the controller, then register each
		// route explicitly for the developers, so reverse routing is possible.
		foreach ($routable as $method => $routes)
		{
			foreach ($routes as $route)
			{
				$this->registerInspected($route, $controller, $method, $names);
			}
		}

		$this->addFallthroughRoute($controller, $uri);
	}
768364
public function alterTable($name, array $options = [])
    {
        $schema = isset($options['schema']) ? new Schema($options['schema']) : null;

        return (new TableApi($name, $schema, $this->manipulation, $this->actions))
            ->alterTable();
    }
903303
public function isAllowedParams(?string $controller = null, ?string $action = null, ?string $role = null): bool
    {
        return $this->isAllowed($role, $this->buildResource($controller, $action));
    }
1372677
public function hasAction($controller, $action = null)
    {
        if ($action === null) {
            list($controller, $action) = explode('.', $controller);
        }
        return in_array("{$controller}.{$action}", $this->action_names);
    }
83834
public function hasResourceParams($controller, $action = null)
    {
        $this->buildAcl();
        $resource = $this->buildResource($controller, $action);
        return parent::hasResource($resource);
    }
325278
public function make($name, $options = [])
    {
        if (!$name || !$this->exists($name)) {
            return null;
        }

        return $name($options);
    }
973453
public function setController($controller, $name = null)
    {
        $controller = $this->app->normalizeClassName($controller, 'Controller');

        return $this->add($controller, $name);
    }
377299
public function addAction($controller, $action = null)
    {
        if ($action === null) {
            list($controller, $action) = explode('.', $controller);
        }
        $this->actions[] = array(
            'controller' => null,
            'controller_name' => $controller,
            'action' => $action,
            'result' => null,
        );
        $this->action_names[] = "{$controller}.{$action}";
    }
1345562
protected function setResourceNew($name, $controller, $action, $options = [])
    {
        return $this->mapResource('get', $name . '/' . $action, $controller, 'get' . ucfirst($action));
    }
1114310
protected function _addMenu($name, $options)
    {
        $requstParams = $this->Controller->request->params;
        if (key_exists('prefix', $requstParams) && $requstParams['prefix'] == 'admin') {
            $this->Controller->Menu->add($options['alias'], [
                'url' => [
                    'prefix' => 'admin',
                    'plugin' => 'PostTypes',
                    'controller' => 'PostTypes',
                    'action' => 'index',
                    'type' => lcfirst($name),
                ]
            ]);
        }
    }
1158302
public function parseDefaults($name, $options)
    {
        $model = $this->config->getDataModel();

        //if the name is not a string or the options is not an array at this point, throw an error because we can't do anything with it
        if (!is_string($name) || !is_array($options)) {
            throw new \InvalidArgumentException('A custom action in your  '.$this->config->getOption('action_name').' configuration file is invalid');
        }

        //set the action name
        $options['action_name'] = $name;

        //set the permission
        $permission                = $this->validator->arrayGet($options, 'permission', false);
        $options['has_permission'] = is_callable($permission) ? $permission($model) : true;

        //check if the messages array exists
        $options['messages'] = $this->validator->arrayGet($options, 'messages', array());
        $options['messages'] = is_array($options['messages']) ? $options['messages'] : array();

        return $options;
    }
74929
protected function addPutResourceUpdate($name, $base, $controller, $options)
    {
        $uri = $this->getResourceUri($name) .'/{' .$base .'}';

        $action = $this->getResourceAction($name, $controller, 'update', $options);

        return $this->router->put($uri, $action);
    }
666522
protected function hasAccess($controllerClass, $action, $parameters = [])
    {
        $user = $this->getSession()->getUser();
        return AclProxy::hasAccess($user, $controllerClass, $action, $parameters);
    }
575001
public function performAction($controller, $action) {
		// Replace namespace with directory separator
		$controllerFile = str_replace("\\", DIRECTORY_SEPARATOR, $controller);

		// Check if controller exists
		if ( false == is_file( $controllerLocation = APP . 'Controllers/' . $controllerFile . '.php' ) )
			throw new ControllerNotFoundException();

		// Include and init the controller
		$controllerClass = "\\Application\\Controllers\\{$controller}";
		$controllerObj = new $controllerClass($this);

		// Check if the action exists
		if ( 'Errors' != $controller && false == method_exists($controllerObj, $action.= "Action" ) )
			throw new ActionNotFoundException();
		// Check if the error display action exists
		elseif ( $controller == $this->defaultRoute['_controller'] && false == method_exists($controllerObj, $action = "display" . $action ) )
			throw new ErrorActionNotFoundException();

		// Run the action
		$data = $controllerObj->{$action}();

		// Data fetching
		if ( false === $controllerObj->__returnActionPerformed ):
			// Format returned data
			if ( false == is_array( $data ) )
				$data = (array) $data;

			// Start reflection for data loading
			$ref = new \ReflectionObject($controllerObj);
			$properties = $ref->getProperties(\ReflectionProperty::IS_PUBLIC);
			$controllerData = array();

			// Get public data
			foreach ( $properties as $property ):
				// Don't add internal variabels
				if ( '__returnActionPerformed' == $property->getName() )
					continue;

				// Add property to controller data
				$controllerData[$property->getName()] = $property->getValue($controllerObj);
			endforeach;

			// Merge data from controller and action
			$data = array_merge($controllerData, $data);
		endif;

		// Return the object
		return $data;
	}