framework/src/Events/BuildClientView.php

50 lines
879 B
PHP
Raw Normal View History

2015-08-27 07:40:18 +08:00
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Events;
2015-07-18 21:29:47 +08:00
use Flarum\Support\ClientAction;
use Flarum\Support\ClientView;
abstract class BuildClientView
2015-07-18 21:29:47 +08:00
{
/**
* @var ClientAction
*/
public $action;
2015-07-18 21:29:47 +08:00
/**
* @var ClientView
*/
public $view;
2015-07-18 21:29:47 +08:00
/**
* @var array
*/
public $keys;
2015-07-18 21:29:47 +08:00
public function assets($files)
{
$this->view->getAssets()->addFiles((array) $files);
}
public function bootstrapper($bootstrapper)
{
$this->view->addBootstrapper($bootstrapper);
}
public function translations(array $keys)
{
foreach ($keys as $key) {
$this->keys[] = $key;
}
}
}