@param bool $action

@return Response|ResponseInterface
325454
public function dispatchAction($action = false)
    {
        $action = Dispatcher::formatActionName($action);
        return $this->callAction($action);
    }
1071946
public function getActionResult($action = null)
    {
        $result = $this->results;

        if (!empty($action)) {
            $result = $this->results[$action];
        }

        return $result;
    }
171753
public function RelativeLink($action = null)
    {
        $link = Controller::join_links(
            $this->ID,
            $action
        );
		
		$this->extend('updateRelativeLink', $link, $action);

        return $link;
	}
1124545
public function themes_api( $false, $action, $response ) {
		if ( ! ( 'theme_information' === $action ) ) {
			return $false;
		}

		$theme = isset( $this->config[ $response->slug ] ) ? $this->config[ $response->slug ] : false;

		// Skip if waiting for background update.
		if ( $this->waiting_for_background_update( $theme ) ) {
			return $false;
		}

		// wp.org theme.
		if ( ! $theme ) {
			return $false;
		}

		$response->slug         = $theme->slug;
		$response->name         = $theme->name;
		$response->homepage     = $theme->uri;
		$response->donate_link  = $theme->donate_link;
		$response->version      = $theme->remote_version;
		$response->sections     = $theme->sections;
		$response->description  = implode( "\n", $theme->sections );
		$response->author       = $theme->author;
		$response->preview_url  = $theme->theme_uri;
		$response->requires     = $theme->requires;
		$response->tested       = $theme->tested;
		$response->downloaded   = $theme->downloaded;
		$response->last_updated = $theme->last_updated;
		$response->rating       = $theme->rating;
		$response->num_ratings  = $theme->num_ratings;

		return $response;
	}
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']);
    }
574727
public function action($action, $parameters = array(), $absolute = true)
    {

        if($path = $this->getPathFinder()->toControllerAction($action, $parameters)){

            if(!$absolute){
                return $path;
            }

            return $this->to($path);
        }

        return parent::action($action, $parameters, $absolute);

    }
1057216
protected function isActionController($action)
    {
        if ($action instanceof Closure) {
            return false;
        }

        return is_string($action) || is_string(isset($action['uses']) ? $action['uses'] : null);
    }
1120602
public function filterPluginsApi($false, $action, $response)
    {
        // basically, verify we're working with our plugin
        if (empty($response->slug)) return false;
        
        $this->updatePluginData();
        if ($response->slug != $this->pluginSlug) return false;
        
        // it's ours, so update the data
        $this->updateGithubData();

        $response->last_updated = $this->githubLatestRelease['published_at'];
        $response->slug = $this->pluginSlug;
        $response->name  = $this->pluginData["Name"];
        $response->version = $this->githubLatestRelease['tag_name'];
        $response->author = $this->pluginData["AuthorName"];
        $response->homepage = $this->pluginData["PluginURI"];
        $response->download_link = $this->githubLatestRelease['zipball_url'];
        
        $parsedown = new \Parsedown();
        $response->sections = [
            'description'   =>  $this->pluginData['Description'],
            'changelog' =>  $parsedown->text($this->githubLatestRelease['body'])
        ];
        
        return $response;
    }
976380
protected function viaApi(string $action): bool
    {
        if (mb_strpos($action, 'api.') === 0) {
            return true; // Saves time in many cases.
        }
        return mb_strpos($action, 'api-v') === 0 && preg_match('/^api\-v[0-9]+[0-9.]*\./u', $action);
    }
1242067
public function callAction($action, $defaultAction = 'request') {
		if (method_exists($this, $action)) return $this->{$action}();
		else return $this->{$defaultAction}();
	}
1196168
protected function _mapAction($action) {
		$actionMap = $this->getConfig('actionMap');
		if (isset($actionMap[$action]) && method_exists($this, $actionMap[$action]['method'])) {
			$pass = (array)$this->_getRequest()->param('pass');
			call_user_func_array([$this, $actionMap[$action]['method']], $pass);

			if ($this->_redirectResponse instanceof Response) {
				return $this->_redirectResponse;
			}

			if (is_string($actionMap[$action]['view'])) {
				try {
					return $this->getController()->render($this->getController()->request->param('action'));
				} catch (MissingTemplateException $e) {
					return $this->getController()->render($actionMap[$action]['view']);
				}
			}

				return $this->_getResponse();
			}

		return false;
	}
1226752
public function beforeAction($action)
    {
        $itemName = '';
        $controller = $action->controller;

        /**
         * @var \yii\web\User $user
         */
        $user = \Yii::$app->getUser();

        if ($user->isGuest) {
            $user->loginRequired();
        }

        if (($module = $controller->module) !== null) {
            $itemName .= $module->id . '.';
            if ($user->can($itemName . '*')) {
                return true;
            }
        }

        $itemName .= $controller->id;
        if ($user->can($itemName . '.*')) {
            return true;
        }

        $itemName .= '.' . $action->id;
        if ($user->can($itemName, $this->params)) {
            return true;
        }

        throw new HttpException(401, \Yii::t('yii', 'You are not permission to perform this action.'));
    }
798200
public function plugins_api( $false, $action, $response ) {
		if ( ! ( 'plugin_information' === $action ) ) {
			return $false;
		}

		$plugin = isset( $this->config[ $response->slug ] ) ? $this->config[ $response->slug ] : false;

		// Skip if waiting for background update.
		if ( $this->waiting_for_background_update( $plugin ) ) {
			return $false;
		}

		// wp.org plugin.
		if ( ! $plugin || ( $plugin->dot_org && 'master' === $plugin->branch ) ) {
			return $false;
		}

		$response->slug          = $plugin->slug;
		$response->plugin_name   = $plugin->name;
		$response->name          = $plugin->name;
		$response->author        = $plugin->author;
		$response->homepage      = $plugin->uri;
		$response->donate_link   = $plugin->donate_link;
		$response->version       = $plugin->remote_version;
		$response->sections      = $plugin->sections;
		$response->requires      = $plugin->requires;
		$response->requires_php  = $plugin->requires_php;
		$response->tested        = $plugin->tested;
		$response->downloaded    = $plugin->downloaded;
		$response->last_updated  = $plugin->last_updated;
		$response->download_link = $plugin->download_link;
		$response->banners       = $plugin->banners;
		$response->icons         = ! empty( $plugin->icons ) ? $plugin->icons : [];
		$response->contributors  = $plugin->contributors;
		if ( ! $this->is_private( $plugin ) ) {
			$response->num_ratings = $plugin->num_ratings;
			$response->rating      = $plugin->rating;
		}

		return $response;
	}
821589
public function setAction($action)
    {
        foreach ($this->routes as $route)
            $route->setAction($action);
        return $this;
    }
495832
public function isAction($action)
    {
        $isAction = parent::isAction($action);
        if ($isAction) {
            return true;
        }

        if ($this->_isActionMapped()) {
            return true;
        }

        return false;
    }
1159707
public function data(string $action = '', bool $allow_dimensions = false)
    {
        $action = $action ?: $this->action;

        if (!$this->action) {
            return; // Not applicable.
        } elseif ($action !== $this->action) {
            return; // Not applicable.
        } elseif (!isset($_REQUEST[$this->data_var])) {
            return; // Not applicable.
        }
        $data = $_REQUEST[$this->data_var];

        if (is_object($data)) {
            $data = (array) $data;
        }
        $data = $this->c::removeKey($data, '___ignore');
        // Removes keys needed to make forms submit an empty array.

        if (!$allow_dimensions && is_array($data)) {
            $data = array_map('strval', $data);
        }
        $data = $this->c::unslash($data);
        $data = $this->c::mbTrim($data);

        return $data;
    }
579758
public function action($action = null)
    {
        if (!is_null($action)) {
            $this->action = $action;
            return $this;
        } else {
            return $this->action ?: '';
        }
    }