Aimeos\ShopBundle\Service\View::create PHP Method

create() public method

Creates the view object for the HTML client.
public create ( Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, string | null $locale = null ) : Aimeos\MW\View\Iface
$context Aimeos\MShop\Context\Item\Iface Context object
$templatePaths array List of base path names with relative template paths as key/value pairs
$locale string | null Code of the current language or null for no translation
return Aimeos\MW\View\Iface View object
    public function create(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null)
    {
        $config = $context->getConfig();
        $view = new \Aimeos\MW\View\Standard($templatePaths);
        $this->addCsrf($view);
        $this->addAccess($view, $context);
        $this->addConfig($view, $config);
        $this->addNumber($view, $config);
        $this->addParam($view);
        $this->addRequest($view);
        $this->addResponse($view);
        $this->addTranslate($view, $locale);
        $this->addUrl($view);
        return $view;
    }