mirror of
https://github.com/flarum/framework.git
synced 2024-11-27 02:53:37 +08:00
Add back defaults for language and direction attributes (#1860)
This commit is contained in:
parent
56dbcf026d
commit
fb45773ecb
|
@ -12,13 +12,30 @@
|
|||
namespace Flarum\Frontend\Content;
|
||||
|
||||
use Flarum\Frontend\Document;
|
||||
use Flarum\Locale\LocaleManager;
|
||||
use Illuminate\Support\Arr;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
class Meta
|
||||
{
|
||||
/**
|
||||
* @var LocaleManager
|
||||
*/
|
||||
private $locales;
|
||||
|
||||
/**
|
||||
* @param LocaleManager $locales
|
||||
*/
|
||||
public function __construct(LocaleManager $locales)
|
||||
{
|
||||
$this->locales = $locales;
|
||||
}
|
||||
|
||||
public function __invoke(Document $document, Request $request)
|
||||
{
|
||||
$document->language = $this->locales->getLocale();
|
||||
$document->direction = 'ltr';
|
||||
|
||||
$document->meta = array_merge($document->meta, $this->buildMeta($document));
|
||||
$document->head = array_merge($document->head, $this->buildHead($document));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user