mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
21 lines
507 B
PHP
21 lines
507 B
PHP
|
<?php
|
||
|
namespace Grav\Plugin\PresentationPlugin;
|
||
|
|
||
|
class CallStaticTwigExtension extends \Twig_Extension
|
||
|
{
|
||
|
public function getName()
|
||
|
{
|
||
|
return 'CallClassExtension';
|
||
|
}
|
||
|
public function getFunctions()
|
||
|
{
|
||
|
return [
|
||
|
new \Twig_SimpleFunction('callstatic', [$this, 'getter'])
|
||
|
];
|
||
|
}
|
||
|
public function getter($class, $method, $params = false)
|
||
|
{
|
||
|
// Cannot get Reflection to work on $class
|
||
|
return PresentationPlugin::$method($params);
|
||
|
}
|
||
|
}
|