Returns the ViewBuilder that matches the given controller string.

@param string $controllerString A controller string to match against. Example: ez_content:viewAction.

@return \eZ\Publish\Core\MVC\Symfony\View\Builder\ViewBuilder|null
199358
public function getFromRegistry($controllerString)
    {
        if (!is_string($controllerString)) {
            return null;
        }

        foreach ($this->registry as $viewBuilder) {
            if ($viewBuilder->matches($controllerString)) {
                return $viewBuilder;
            }
        }

        return null;
    }
1155604
protected function buildContentTranslateView(array $viewConfig): ContentTranslateView
    {
        $view = new ContentTranslateView();
        $view->setConfigHash($viewConfig);
        if (isset($viewConfig['template'])) {
            $view->setTemplateIdentifier($viewConfig['template']);
        }
        if (isset($viewConfig['controller'])) {
            $view->setControllerReference(new ControllerReference($viewConfig['controller']));
        }
        if (isset($viewConfig['params']) && is_array($viewConfig['params'])) {
            $view->addParameters($viewConfig['params']);
        }

        return $view;
    }
1303136
public function getCompiler(string $extension): CompilerStrategy
    {
        if (!$this->hasCompiler($extension)) {
            throw new ViewException('View compiler for extension `' . $extension . '` not found.');
        }

        $compiler = &$this->compilers[$extension];

        if (is_callable($compiler)) {
            $compiler = call_user_func_array($compiler, [$this]);
        }

        if (!($compiler instanceof CompilerStrategy)) {
            throw new ViewException('View compiler for extension `' . $extension . '` should be an instance of `' . CompilerStrategy::class . '`.');
        }

        return $compiler;
    }
1120267
private function getDTO(array $viewConfig)
    {
        $dto = new CoreContentView();
        $dto->setConfigHash($viewConfig);

        if (isset($viewConfig['template'])) {
            $dto->setTemplateIdentifier($viewConfig['template']);
        }

        if (isset($viewConfig['controller'])) {
            $dto->setControllerReference(new ControllerReference($viewConfig['controller']));
        }

        if (isset($viewConfig['params']) && is_array($viewConfig['params'])) {
            $dto->addParameters($viewConfig['params']);
        }

        return $dto;
    }
760121
private static function str2closure($controllerAction)
    {
        list($controller, $action) = explode('@', $controllerAction);
        return function($request) use ($controller, $action) {
            $c = new $controller;
            return call_user_func([$c, $action], $request);
        };
    }
834946
public function loadView($viewName, $pData = NULL, $asString = false) {
		if(!URequest::isAjax() && $this->_getAuthController()->_displayInfoAsString()){
			$this->view->setVar("_userInfo",$this->_getAuthController()->info());
		}
		return parent::loadView ($viewName,$pData,$asString);
	}
1097164
protected function _findViewByRequest()
    {
        $paths = App::path('Template', $this->plugin);

        $action      = (string) $this->request->getParam('action');
        $controller  = $this->request->getParam('controller');
        $viewFile    = $action . $this->_ext;
        $viewSubPath = $this->_getSubPaths($controller);

        foreach ($paths as $path) {
            foreach ($viewSubPath as $subPath) {
                $full = $path . $subPath . DS . $viewFile;
                if (FS::isFile($full)) {
                    return $action;
                }

                $formView = $path . $subPath . DS . self::VIEW_FORM . $this->_ext;
                if (FS::isFile($formView)) {
                    return self::VIEW_FORM;
                }
            }
        }

        return null;
    }
1164243
public function getPluginNodeByAction(NodeInterface $currentNode, $controllerObjectName, $actionName)
    {
        $viewDefinition = $this->getPluginViewDefinitionByAction($controllerObjectName, $actionName);

        if ($currentNode->getNodeType()->isOfType('Neos.Neos:PluginView')) {
            $masterPluginNode = $this->getPluginViewNodeByMasterPlugin($currentNode, $viewDefinition->getName());
        } else {
            $masterPluginNode = $currentNode;
        }

        if ($viewDefinition !== null) {
            $viewNode = $this->getPluginViewNodeByMasterPlugin($currentNode, $viewDefinition->getName());
            if ($viewNode instanceof Node) {
                return $viewNode;
            }
        }

        return $masterPluginNode;
    }
1196512
public function getController($controllerName = null, $actionName = 'index')
    {
        if (null !== $controllerName or 'index' !== $actionName) {
            $className = empty($controllerName) ? $this->module : $controllerName;

            return [
                '_controller' => $this->module.'ModuleBundle:'.$className.':'.$actionName,
            ];
        }

        if (empty($this->controller)) {
            $className = (null === $controllerName) ? $this->module : $controllerName;
            $this->controller['_controller'] = $this->module.'ModuleBundle:'.$className.':'.$actionName;
        }

        return $this->controller;
    }
130953
public function getViewBuilder()
    {
        if (null === $this->viewBuilder) {
            $this->viewBuilder = new View\ViewBuilder();
            $this->viewBuilder->setEditor($this);
        }

        return $this->viewBuilder;
    }
790901
public function getModel($controllerName) {
		$array = \explode ( "\\", $controllerName );
		$result = \ucfirst ( end ( $array ) );
		if (UString::endswith ( $result, "s" )) {
			$result = \substr ( $result, 0, - 1 );
		}
		return $result;
	}
607456
protected function findNamespaceInController(&$controller)
    {
        if (strstr($controller, '\\')) {
            $namespace = explode('\\', $controller);
            $controller = end($namespace);
            $namespace = rtrim(join('\\', array_slice($namespace, 0, count($namespace) - 1)), '\\');
        } else {
            $namespace = isset($this->group['_namespace']) ? $this->group['namespace'] : null;
        }

        return $namespace;
    }
1228357
public function find($url)
    {
        if (!array_key_exists($url, $this->controllerMap)) {
            return null;
        }

        return $this->controllerMap[$url];
    }
1368814
public static function getRenderer( $renderer, ezpContent $content, ezpRestMvcController $controller )
    {
        // If no content renderer has been given, we fall back to built-in 'xhtml' renderer.
        // Note: empty string is not a valid input.
        if ( empty( $renderer ) )
        {
            $renderer = self::DEFAULT_RENDERER;
        }

        if ( !( self::$renderer instanceof ezpRestContentProviderInterface ) )
        {
            self::$renderer = self::createRenderer( $renderer, $content, $controller );
        }

        return self::$renderer;
    }
236113
protected function getLayout(View $viewConfiguration)
    {
        $layout = $this->arguments['layout'];

        if (false === is_string($layout)) {
            throw InvalidArgumentTypeException::invalidTypeNameArgumentFieldViewHelper($layout);
        }

        list($layoutName, $templateName) = GeneralUtility::trimExplode('.', $layout);

        if (empty($templateName)) {
            $templateName = 'default';
        }

        if (empty($layoutName)) {
            throw InvalidArgumentValueException::fieldViewHelperEmptyLayout();
        }

        if (false === $viewConfiguration->hasLayout($layoutName)) {
            throw EntryNotFoundException::fieldViewHelperLayoutNotFound($layout);
        }

        if (false === $viewConfiguration->getLayout($layoutName)->hasItem($templateName)) {
            throw EntryNotFoundException::fieldViewHelperLayoutItemNotFound($layout, $templateName);
        }

        return $viewConfiguration->getLayout($layoutName)->getItem($templateName);
    }
898763
public function render($viewName, $pData, $asString) {
		$pData ["config"] = Startup::getConfig ();
		EventsManager::trigger ( ViewEvents::BEFORE_RENDER, $viewName, $pData );
		$render = $this->twig->render ( $viewName, $pData );
		EventsManager::trigger ( ViewEvents::AFTER_RENDER, $render, $viewName, $pData );
		if ($asString) {
			return $render;
		} else {
			echo $render;
		}
	}
864672
private function getControllerParams(Request $request, $controllerString)
    {
        $query = $request->query->all();
        $methodParameters = $this->getControllerParameters($controllerString);

        $parameters = array();
        foreach ($methodParameters as $methodParameter) {
            $parameterName = $methodParameter->getName();
            if ('request' === $parameterName) continue;

            if (isset($query[$parameterName])) {
                $parameters[$parameterName] = $query[$parameterName];
                unset($query[$parameterName]);
            }
        }

        return array($parameters, $query);
    }