Пример #1
0
 public function testCustomClassPluginInstanceAsModifier()
 {
     $dwoo = new Dwoo(DWOO_COMPILE_DIR, DWOO_CACHE_DIR);
     $dwoo->addPlugin('CustomClassPlugin', array(new custom_class_plugin_obj(), 'call'));
     $tpl = new Dwoo_Template_String('{$foo=4}{$foo|CustomClassPlugin:5}');
     $tpl->forceCompilation();
     $this->assertEquals('20', $dwoo->get($tpl, array(), $this->compiler));
 }
Пример #2
0
 public function testCallingMethodOnPropery()
 {
     $tpl = new Dwoo_Template_String('{getobj()->instance->Bar("hoy")}');
     $tpl->forceCompilation();
     $dwoo = new Dwoo(DWOO_COMPILE_DIR, DWOO_CACHE_DIR);
     $dwoo->addPlugin('getobj', array(new PluginHelper(), 'call'));
     $this->assertEquals('HOY', $dwoo->get($tpl, array(), $this->compiler));
 }