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.
상속: use trait Webiny\Component\StdLib\StdLibTrait
예제 #1
0
 public function __construct()
 {
     parent::__construct('myCustomUpper', 'modifier', '\\Webiny\\Component\\TemplateEngine\\Tests\\Bridge\\Smarty\\Mocks\\PluginMock::myCallback');
 }
예제 #2
0
 /**
  * @dataProvider dataProvider
  */
 public function testGetParams(Plugin $p)
 {
     $this->assertSame(['p1' => 'a', 'p2' => 'b'], $p->getParams());
 }
예제 #3
0
파일: Smarty.php 프로젝트: Webiny/Framework
 /**
  * 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);
     }
 }