Executes the action and outputs the result.

@param ActionContext $actionContext The context in which the result is executed.
The context information includes information about the action that was executed and request information.

@return void
174774
public function execute($actionContext) {
        $this->url = UrlHelper::action($actionContext, $this->actionName, $this->controllerName, $this->routeValues, $this->fragment);
        parent::execute($actionContext);
    }
742436
protected final ActionBinding findActionBinding(ActionContext actionContext) {
		for (ActionBinding actionBinding : this.actionBindings) {
			if (actionBinding.supports(actionContext)) {
				return actionBinding;
			}
		}
		return null;
	}
467700
public function handleAction(ActionEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $this->checkLanguage($event->getEnvironment(), 'create' === $event->getAction()->getName());
    }
1274007
protected function _actionRead(ControllerContext $context)
    {
        if(!$context->result instanceof ModelEntityInterface)
        {
            if($this->getModel()->getState()->isUnique())
            {
                $entity = $this->getModel()->fetch();

                if(!count($entity))
                {
                    $name   = ucfirst($this->getView()->getName());
                    throw new ControllerExceptionResourceNotFound($name.' Not Found');
                }
            }
            else $entity = $this->getModel()->create();
        }
        else $entity = $context->result;

        //Set the entity in the context
        $context->setEntity($entity);

        return $entity;
    }
1141530
protected function _actionBrowse(ControllerContext $context)
    {
        $entity = $this->getModel()->fetch();

        //Set the entity in the context
        $context->setEntity($entity);

        return $entity;
    }
589565
protected function _actionException(AnCommandContext $context)
    {
        if (
            $context->data instanceof LibBaseControllerExceptionUnauthorized &&
            $this->getController() instanceof ComPeopleControllerSession
        ) {
            $context->response->send();
            exit(0);
        } else {
            parent::_actionException($context);
        }
    }
200490
public function handleAction(ActionEvent $event)
    {
        $GLOBALS['TL_CSS']['cca.dc-general.generalDriver'] = 'bundles/ccadcgeneral/css/generalDriver.css';

        if ((null !== $event->getResponse())
            || $event->getEnvironment()->getDataDefinition()->getName()
               !== $this->environment->getDataDefinition()->getName()
        ) {
            return;
        }

        $action = $event->getAction();
        $name   = $action->getName();

        if ('show' === $name) {
            $handler = new ShowHandler($this->scopeDeterminator);
            $handler->handleEvent($event);

            return;
        }

        if ('showAll' === $name) {
            $response = \call_user_func_array(
                [$this, $name],
                \array_merge([$action], $action->getArguments())
            );
            $event->setResponse($response);

            return;
        }

        if ('select' === $name) {
            $response = \call_user_func_array(
                [$this, $name],
                \array_merge([$action], $action->getArguments())
            );
            $event->setResponse($response);

            return;
        }

        if (!\in_array($name, ['create', 'move', 'undo', 'edit'])) {
            return;
        }

        $response = \call_user_func_array(
            [$this, $name],
            \array_merge([$action], $action->getArguments())
        );
        $event->setResponse($response);
    }
389653
public function handle(ComponentContext $componentContext)
    {
        $componentContext = $this->prepareActionRequest($componentContext);
        $actionRequest = $componentContext->getParameter(DispatchComponent::class, 'actionRequest');
        $this->setDefaultControllerAndActionNameIfNoneSpecified($actionRequest);
        $actionResponse = $this->prepareActionResponse($componentContext->getHttpResponse());
        $this->dispatcher->dispatch($actionRequest, $actionResponse);
        // TODO: This should change in next major when the action response is no longer a HTTP response for backward compatibility.
        $componentContext->replaceHttpResponse($actionResponse);
    }
707993
protected void execute(ActionList actionList) {
        ProcessResult processResult = translet.getProcessResult();
        if (processResult == null) {
            processResult = new ProcessResult(1);
            translet.setProcessResult(processResult);
        }

        ContentResult contentResult = processResult.getContentResult(actionList.getName(), actionList.isExplicit());
        if (contentResult == null) {
            contentResult = new ContentResult(processResult, actionList.size());
            contentResult.setName(actionList.getName());
            if (!processResult.isExplicit()) {
                contentResult.setExplicit(actionList.isExplicit());
            }
        }

        for (Executable action : actionList) {
            execute(action, contentResult);
            if (isResponseReserved()) {
                break;
            }
        }
    }
8655
public function execute($actionContext) {
        // make json and exit
        if (($result = json_encode($this->data, $this->options, $this->depth)) === false) {
            throw new \ErrorException('JSON encode error #' . json_last_error() . ': ' . json_last_error_msg());
        }

        $response = $actionContext->getHttpContext()->getResponse();
        $response->addHeader('Content-Type', 'application/json');
        $response->write($result);
        $response->end();
    }
700842
protected function _actionEdit(AnCommandContext $context)
    {
        $result = parent::_actionEdit($context);
        $this->registerCallback('after.edit', array($this, 'redirect'));
    }
1267401
protected function _actionEdit(ControllerContext $context)
    {
        $entities = $context->entity;

        if(count($entities))
        {
            foreach($entities as $entity) {
                $entity->setProperties($context->request->data->toArray());
            }

            //Only set the reset content status if the action explicitly succeeded
            if($entities->save() === true) {
                $context->response->setStatus(HttpResponse::RESET_CONTENT);
            }
        }
        else throw new ControllerExceptionResourceNotFound('Resource could not be found');

        return $entities;
    }
672336
public function handle(ComponentContext $componentContext)
    {
        $routingMatchResults = $componentContext->getParameter(RoutingComponent::class, 'matchResults');
        if ($routingMatchResults !== NULL) {
            return;
        }
        $httpRequest = $componentContext->getHttpRequest();
        $response = $this->redirectService->buildResponseIfApplicable($httpRequest);
        if ($response !== null) {
            $componentContext->replaceHttpResponse($response);
            $componentContext->setParameter(ComponentChain::class, 'cancel', true);
        }
    }
387185
public function canRender(ControllerContext $controllerContext)
    {
        $this->setControllerContext($controllerContext);
        try {
            $this->getTemplateSource();
            return true;
        } catch (Exception\InvalidTemplateResourceException $e) {
            return false;
        }
    }
782995
protected void executeActions(TestContext context) {
        context.setVariable(indexName, String.valueOf(index));

        for (TestAction action: actions) {
            setActiveAction(action);
            action.execute(context);
        }
    }
95951
public function handleEvent(ActionEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $environment = $event->getEnvironment();

        if (null === ($serializedId = $this->getModelId($environment))) {
            return;
        }

        $operation = $this->getOperation($event->getAction(), $environment);
        if (!($operation instanceof ToggleCommandInterface)) {
            return;
        }

        if (false === $this->checkPermission($event)) {
            $event->stopPropagation();

            return;
        }

        $this->process($environment, $operation, $serializedId);
    }
1236646
public function handle(ComponentContext $componentContext)
    {
        if (!isset($this->options['components'])) {
            return;
        }
        /** @var ComponentInterface $component */
        foreach ($this->options['components'] as $component) {
            if ($component === null) {
                continue;
            }
            $component->handle($componentContext);
            $this->response = $componentContext->getHttpResponse();
            if ($componentContext->getParameter(ComponentChain::class, 'cancel') === true) {
                $componentContext->setParameter(ComponentChain::class, 'cancel', null);
                return;
            }
        }
    }