1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-31 19:30:40 +02:00

finished TOC feature

This commit is contained in:
Sebastian
2017-11-29 21:51:47 +01:00
parent 4bea02cb16
commit 7da2060cae
30 changed files with 605 additions and 276 deletions

View File

@@ -7,9 +7,9 @@ use \Symfony\Component\EventDispatcher\EventSubscriberInterface;
abstract class Plugin implements EventSubscriberInterface
{
protected $app;
private $app;
protected $container;
private $container;
/**
* Constructor.
@@ -28,16 +28,51 @@ abstract class Plugin implements EventSubscriberInterface
{
return $this->container['request']->getUri();
}
protected function getPath()
{
$route = $this->container['request']->getUri();
return $route->getPath();
return $this->container['request']->getUri()->getPath();
}
protected function getDispatcher($dispatcher)
protected function getDispatcher()
{
return $dispatcher;
return $this->$dispatcher;
}
}
protected function addTwigGlobal($name, $class)
{
$this->container->view->getEnvironment()->addGlobal($name, $class);
}
protected function addTwigFilter($name, $filter)
{
$filter = new \Twig_SimpleFilter($name, $filter);
$this->container->view->getEnvironment()->addFilter($filter);
}
protected function addTwigFunction($name, $function)
{
$function = new \Twig_SimpleFunction($name, $function);
$this->container->view->getEnvironment()->addFunction($function);
}
protected function addJS($JS)
{
$this->container->assets->addJS($JS);
}
protected function addInlineJS($JS)
{
$this->container->assets->addInlineJS($JS);
}
protected function addCSS($CSS)
{
$this->container->assets->addCSS($CSS);
}
protected function addInlineCSS($CSS)
{
$this->container->assets->addInlineCSS($CSS);
}
}