This class is used by template engines to register plugins.
Based on the template engine a plugin can be a modifier, a tag, a filter or something else.
public function __construct() { parent::__construct('myCustomUpper', 'modifier', '\\Webiny\\Component\\TemplateEngine\\Tests\\Bridge\\Smarty\\Mocks\\PluginMock::myCallback'); }
/** * @dataProvider dataProvider */ public function testGetParams(Plugin $p) { $this->assertSame(['p1' => 'a', 'p2' => 'b'], $p->getParams()); }
/** * Register a plugin for the template engine. * * @param Plugin $plugin * * @throws \Exception|SmartyException * @return void */ public function registerPlugin(Plugin $plugin) { try { $this->smarty->registerPlugin($plugin->getType(), $plugin->getName(), $plugin->getCallbackFunction(), $plugin->getAttribute('Cachable', true), $plugin->getAttribute('CacheAttr', null)); } catch (\SmartyException $e) { throw new SmartyException($e); } }