for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) Flipbox Digital Limited
* @license https://github.com/flipbox/ember/blob/master/LICENSE
* @link https://github.com/flipbox/ember
*/
namespace flipbox\ember;
use craft\events\RegisterTemplateRootsEvent;
use craft\web\View;
use yii\base\Event;
use yii\base\Module;
* @author Flipbox Factory <[email protected]>
* @since 1.0.0
class Ember extends Module
{
* @inheritdoc
public function init()
parent::init();
// Base template directory
Event::on(View::class, View::EVENT_REGISTER_CP_TEMPLATE_ROOTS, function (RegisterTemplateRootsEvent $e) {
if (is_dir($baseDir = $this->getBasePath() . DIRECTORY_SEPARATOR . 'templates')) {
$e->roots[$this->uniqueId] = $baseDir;
}
});