public registerPlugin ( |
||
$plugin | ||
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);
}
}
/** * @dataProvider dataProvider */ public function testRegisterPlugin(Smarty $smarty) { $plugin = new PluginMock(); $smarty->registerPlugin($plugin); $smarty->assign('name', 'world'); $result = $smarty->fetch('TestPlugin.tpl'); $this->assertSame('Hello WORLD', $result); }