/** * Returns the resource controller * * @param ContainerInterface $container Dependency injection container * @param ServerRequestInterface $request Request object * @param ResponseInterface $response Response object * @param array $args Associative list of route parameters * @return \Aimeos\Admin\JQAdm\Iface JQAdm client */ protected static function createClient(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) { $resource = isset($args['resource']) ? $args['resource'] : null; $site = isset($args['site']) ? $args['site'] : 'default'; $lang = isset($args['lang']) ? $args['lang'] : 'en'; $templatePaths = $container->get('aimeos')->getCustomPaths('admin/jqadm/templates'); $context = $container->get('aimeos_context')->get(false, $args, 'backend'); $context->setI18n($container->get('aimeos_i18n')->get(array($lang, 'en'))); $context->setLocale($container->get('aimeos_locale')->getBackend($context, $site)); $view = $container->get('aimeos_view')->create($context->getConfig(), $request, $response, $args, $templatePaths, $lang); $context->setView($view); return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); }
/** * Returns the resource controller * * @return \Aimeos\MShop\Context\Item\Iface Context item */ protected function createClient() { $site = Route::input('site', Input::get('site', 'default')); $lang = Input::get('lang', config('app.locale', 'en')); $resource = Route::input('resource'); $aimeos = app('\\Aimeos\\Shop\\Base\\Aimeos')->get(); $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); $context = app('\\Aimeos\\Shop\\Base\\Context')->get(false); $context = $this->setLocale($context, $site, $lang); $view = app('\\Aimeos\\Shop\\Base\\View')->create($context->getConfig(), $templatePaths, $lang); $context->setView($view); return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); }
/** * Returns the resource controller * * @param string $sitecode Unique site code * @return \Aimeos\MShop\Context\Item\Iface Context item */ protected function createClient($sitecode, $resource) { $lang = $this->request->hasArgument('lang') ? $this->request->getArgument('lang') : 'en'; $templatePaths = $this->aimeos->get()->getCustomPaths('admin/jqadm/templates'); $context = $this->context->get(null, 'backend'); $context->setI18n($this->i18n->get(array($lang, 'en'))); $context->setLocale($this->locale->getBackend($context, $sitecode)); $context->setView($this->viewbase->create($context, $this->uriBuilder, $templatePaths, $this->request, $lang)); return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); }
/** * Returns the resource controller * * @param Request $request Symfony request object * @param string $site Unique site code * @param string $resource Resource location, e.g. "product" * @return \Aimeos\Admin\JQAdm\Iface Context item */ protected function createClient(Request $request, $site, $resource) { $lang = $request->get('lang', 'en'); $aimeos = $this->get('aimeos')->get(); $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); $context = $this->get('aimeos_context')->get(false); $context = $this->setLocale($context, $site, $lang); $view = $this->get('aimeos_view')->create($context->getConfig(), $templatePaths, $lang); $context->setView($view); return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); }
/** * Returns the resource controller * * @return \Aimeos\Admin\JQAdm\Iface JQAdm client */ protected function createClient() { $resource = 'dashboard'; if ($this->request->hasArgument('resource')) { $resource = $this->request->getArgument('resource'); } $templatePaths = Base::getAimeos()->getCustomPaths('admin/jqadm/templates'); $context = $this->getContextBackend($templatePaths); return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); }
public function testCreateClientNameNotFound() { $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->templatePaths, 'prod'); }