fetch() public method

Fetch the template from the given location, parse it and return the output.
public fetch ( string $template, array $parameters = [] ) : string
$template string Path to the template.
$parameters array A list of parameters to pass to the template.
return string Parsed template.
Exemplo n.º 1
0
 /**
  * @dataProvider dataProvider
  */
 public function testRegisterExtensions(Smarty $smarty)
 {
     DemoComponent::setConfig(__DIR__ . '/Mocks/DemoComponentConfig.yaml');
     $smarty->registerExtensions();
     $smarty->assign('name', 'WORLD');
     $result = $smarty->fetch('DemoComponent.tpl');
     $this->assertSame('Hello world', $result);
 }