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:
43
system/Plugin.php
Normal file
43
system/Plugin.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user