本文整理汇总了PHP中Aimeos\MShop\Context\Item\Iface::setI18n方法的典型用法代码示例。如果您正苦于以下问题:PHP Iface::setI18n方法的具体用法?PHP Iface::setI18n怎么用?PHP Iface::setI18n使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aimeos\MShop\Context\Item\Iface
的用法示例。
在下文中一共展示了Iface::setI18n方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Returns the current context
*
* @param boolean $locale True to add locale object to context, false if not (deprecated, use \Aimeos\Shop\Base\Locale)
* @param string $type Configuration type, i.e. "frontend" or "backend" (deprecated, use \Aimeos\Shop\Base\Config)
* @return \Aimeos\MShop\Context\Item\Iface Context object
*/
public function get($locale = true, $type = 'frontend')
{
$config = $this->config->get($type);
if ($this->context === null) {
$context = new \Aimeos\MShop\Context\Item\Standard();
$context->setConfig($config);
$this->addDataBaseManager($context);
$this->addFilesystemManager($context);
$this->addMessageQueueManager($context);
$this->addLogger($context);
$this->addCache($context);
$this->addMailer($context);
$this->addSession($context);
$this->addUser($context);
$this->addGroups($context);
$this->context = $context;
}
$this->context->setConfig($config);
if ($locale === true) {
$localeItem = $this->locale->get($this->context);
$this->context->setLocale($localeItem);
$this->context->setI18n($this->i18n->get(array($localeItem->getLanguageId())));
}
return $this->context;
}