1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-06 14:16:46 +02:00

event system and plugins

This commit is contained in:
Sebastian
2017-11-17 17:44:02 +01:00
parent 53aaba7a57
commit f3f2c0cb07
45 changed files with 3654 additions and 130 deletions

43
system/Plugin.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
namespace Typemill;
use \Symfony\Component\EventDispatcher\EventSubscriberInterface;
abstract class Plugin implements EventSubscriberInterface
{
protected $app;
protected $container;
/**
* Constructor.
*
* @param string $name
* @param Grav $grav
* @param Config $config
*/
public function __construct($container, $app)
{
$this->container = $container;
$this->app = $app;
}
protected function getRoute()
{
return $this->container['request']->getUri();
}
protected function getPath()
{
$route = $this->container['request']->getUri();
return $route->getPath();
}
protected function getDispatcher($dispatcher)
{
return $dispatcher;
}
}