Get the controller context

@param   ControllerContextInterface $context Context to cast to a local context
@return  ControllerContextModel
196062
public function getContext(ControllerContextInterface $context = null)
    {
        $context = new ControllerContextModel(parent::getContext($context));
        return $context;
    }
1317965
private function responseFrom(ControllerContextInterface $context)
    {
        $response = $context->response();
        if (! $response instanceof ResponseInterface) {
            throw new MissingResponseException(
                "Missing response object after handle the request. If you disabled rendering you need to ".
                "provide an HTTP response object to be returned to the client. Use Context::setResponse() ".
                "to provide a response to be returned."
            );
        }

        return $response;
    }
509019
private function getRouteVars(RouteContextInterface $context, array $parameters)
    {
        return array_merge(
            array_combine(array_values($v = $context->getVars()), array_fill(1, count($v), null)),
            $parameters
        );
    }
1150980
public function getTarget(OperationContextInterface $context = null)
    {
        $context = $this->ensureContext($context);
        $targetId = $this->getTargetId();
        if ($targetId === null) {
            return null;
        }

        return $this->getSession()->getObject($targetId, $context);
    }
1343047
protected function loadContextObject()
    {
        $route = $this->getObjectRouteFromPath();

        $obj = $this->modelFactory()->create($route->routeObjType());
        $obj->load($route->routeObjId());

        return $obj;
    }
67102
public function context($context = null)
    {
        if (is_null($context) || empty($context) || $context == "this") {
            $context = null;
        } else {
            $this->__contextAwareContext = $context;
        }
        return $this;
    }
448920
protected function _actionCancel(ControllerContextModel $context)
    {
        //Create the redirect
        $context->response->setRedirect($this->getReferrer($context));

        if ($context->result instanceof ModelEntityInterface) {
            $entity = $context->result;
        }
        else $entity = $this->getModel()->fetch();

        return $entity;
    }
1251642
protected function _beforeRender(ControllerContext $context)
    {
        $controller = $context->getSubject();

        // Add toolbars on authenticated requests only.
        if ($controller->getUser()->isAuthentic())
        {
            //Add the toolbars
            $toolbars = (array)ObjectConfig::unbox($this->getConfig()->toolbars);

            foreach ($toolbars as $key => $value)
            {
                if (is_numeric($key)) {
                    $this->addToolbar($value);
                } else {
                    $this->addToolbar($key, $value);
                }
            }
        }

        //Add the template filter and inject the toolbars
        if($controller->getView() instanceof ViewTemplatable) {
            $controller->getView()->getTemplate()->addFilter('toolbar', array('toolbars' => $this->getToolbars()));
        }
    }
648279
protected function getContext()
	{
		$lv = $this->getLaravel();
		$aimeos = $lv->make( 'aimeos' )->get();
		$context = $lv->make( 'aimeos.context' )->get( false, 'command' );

		$tmplPaths = $aimeos->getCustomPaths( 'controller/jobs/templates' );
		$view = $lv->make( 'aimeos.view' )->create( $context, $tmplPaths );

		$langManager = \Aimeos\MShop::create( $context, 'locale/language' );
		$langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) );
		$i18n = $lv->make( 'aimeos.i18n' )->get( $langids );

		$context->setEditor( 'aimeos:jobs' );
		$context->setView( $view );
		$context->setI18n( $i18n );

		return $context;
	}
134988
public function getContext(ModelContextInterface $context = null)
    {
        $context = new ModelContext($context);
        $context->setState($this->getState());
        $context->setIdentityKey($this->_identity_key);

        return $context;
    }
937793
public function findReferrer(KControllerContextInterface $context)
    {
        if(JFactory::getApplication()->isSite())
        {
            $redirect = sprintf('index.php?Itemid=%d', $context->request->query->Itemid);
            $referrer = $this->getObject('lib:http.url', array('url' => JRoute::_($redirect, false)));
        }
        else $referrer = parent::findReferrer($context);

        return $referrer;
    }
167701
protected function _beforeRender(ControllerContext $context)
    {
        $controller = $context->getSubject();

        if (!$controller->isDispatched()) {
            $controller->loadLanguage();
        }
    }
844255
protected function getParser($context = null)
    {
        $parser = $this->getComponent('parser');

        $parser->registeredVars['context'] = $context;

        return $parser;
    }
1287635
protected function getExecutionContext() {
        if (!$this->_executionContext) {
            $this->_executionContext = new ExecutionContextList(
                $this->version,
                $this->solution['flowSid'],
                $this->solution['sid']
            );
        }

        return $this->_executionContext;
    }
875610
public function lookupController(N2nContext $n2nContext, ControllerContext $delegateControllerContext): Controller {
		return $n2nContext->lookup($this->customSpec->getControllerLookupId());
	}
525631
public function serializePayload(ControllerContext $controllerContext)
    {
        return [
            'contextPath' => $this->getNode()->getContextPath(),
            'parentDomAddress' => $this->getParentDomAddress(),
            'siblingDomAddress' => $this->getSiblingDomAddress(),
            'mode' => $this->getMode(),
            'renderedContent' => $this->renderContent($controllerContext)
        ];
    }
400416
public function getContextLocale($context)
    {
        return isset($this->contextLocales[$context]) ? $this->contextLocales[$context] : null;
    }