Phrozn\Processor\Scss::render PHP Method

render() public method

Parse the incoming template
public render ( string $tpl, array $vars = [] ) : string
$tpl string Source template content
$vars array List of variables passed to template engine
return string Processed template
    public function render($tpl, $vars = array())
    {
        return $this->getEnvironment()->compile($tpl);
    }

Usage Example

Example #1
0
 public function testRender()
 {
     $configSample = array('some' => 'setting');
     $processor = new Processor($configSample);
     $tpl = file_get_contents($this->path . 'tpl1.scss');
     $rendered = $processor->render($tpl, array('some' => 'val'));
     $static = file_get_contents($this->path . 'tpl1.scss.css');
     $this->assertSame(trim($static), trim($rendered));
     $this->assertSame($processor->getConfig(), $configSample);
 }