forked from rossriley/bolt-extension-colourpicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtension.php
32 lines (26 loc) · 802 Bytes
/
Extension.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace Bolt\Extensions\Bolt\Colourpicker;
use Bolt\Application;
use Bolt\BaseExtension;
class Extension extends BaseExtension
{
public function __construct(Application $app)
{
parent::__construct($app);
$this->app['config']->fields->addField(new ColourPickField());
if ($this->app['config']->getWhichEnd() === 'backend') {
$this->app['htmlsnippets'] = true;
$this->app['twig.loader.filesystem']->prependPath(__DIR__.'/twig');
}
}
public function initialize()
{
$this->addCss('assets/colourpicker.css');
$this->addJavascript('assets/colourpicker.js', true);
$this->addJavascript('assets/start.js', true);
}
public function getName()
{
return 'colourpicker';
}
}