Locale resolver that extracts site, language, and currency from routes/requests and bootstraps the Aimeos locale manager for multi-site e-commerce.
<?php
/**
* @license MIT, http://opensource.org/licenses/MIT
* @copyright Aimeos (aimeos.org), 2015-2023
*/
namespace Aimeos\Shop\Base;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Route;
/**
* Service providing the context objects
*/
class Locale
{
/**
* @var \Illuminate\Contracts\Config\Repository
*/
private $config;
/**
* @var \Aimeos\MShop\Locale\Item\Iface
*/
private $locale;
/**
* Initializes the object
*
* @param \Illuminate\Contracts\Config\Repository $config Configuration object
*/
public function __construct( \Illuminate\Contracts\Config\Repository $config )
{
$this->config = $config;
}
/**
* Returns the locale item for the current request
*
* @param \Aimeos\MShop\ContextIface $context Context object
* @
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key