-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtension.php
41 lines (26 loc) · 849 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
33
34
35
<?php
namespace Bolt\Extension\Dpfavand\Jsonfieldtype;
use Bolt\Application;
use Bolt\BaseExtension;
include_once "JSONField.php";
class Extension extends BaseExtension
{
public function __construct(Application $app)
{
parent::__construct($app);
$this->app['config']->fields->addField(new JSONField());
if ($this->app['config']->getWhichEnd()=='backend') {
$this->app['htmlsnippets'] = true;
$this->app['twig.loader.filesystem']->prependPath(__DIR__."/twig");
}
}
public function initialize() {
$this->addCss('assets/jquery.json-editor.css');
$this->addJavascript('assets/jquery.json-editor.js', true);
$this->addJavascript('assets/json2.js', true);
}
public function getName()
{
return "jsonfieldtype";
}
}