Aimeos\ShopBundle\Controller\JsonadmController::createClient PHP Method

createClient() protected method

Returns the resource controller
protected createClient ( string $site, $resource, string $lang ) : Aimeos\MShop\Context\Item\Iface
$site string Unique site code
$lang string Language code
return Aimeos\MShop\Context\Item\Iface Context item
    protected function createClient($site, $resource, $lang)
    {
        $aimeos = $this->get('aimeos')->get();
        $templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates');
        $context = $this->get('aimeos_context')->get(false, 'backend');
        $context->setI18n($this->get('aimeos_i18n')->get(array($lang, 'en')));
        $context->setLocale($this->get('aimeos_locale')->getBackend($context, $site));
        $view = $this->get('aimeos_view')->create($context, $templatePaths, $lang);
        $context->setView($view);
        return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $templatePaths, $resource);
    }