src/components/Compiler.php
public function compile($template, $data)
    {
        foreach ($data as $key => $value) {
            // TODO refactor code so that we do not need this check
            if (!is_string($value)) {
                continue;
            }

            $template = preg_replace("/\\$$key\\$/i", $value, $template);
        }

        return preg_replace('/(<?php)/', "$1\n" . $this->renderBanner(), $template, 1);
    }
public function compile($template, $data)
    {
        foreach ($data as $key => $value) {
            // TODO refactor code so that we do not need this check
            if (!is_string($value)) {
                continue;
            }

            $template = preg_replace("/\\$$key\\$/i", $value, $template);
        }

        return preg_replace('/(<?php)/', "$1\n" . $this->renderBanner(), $template, 1);
    }
public function compile ( $ template , $ data ) { foreach ( $ data as $ key => $ value ) { // TODO refactor code so that we do not need this check if ( ! is_string ( $ value ) ) { continue ; } $ template = preg_replace ( "/\\$$key\\$/i" , $ value , $ template ) ; } return preg_replace ( '/(<?php)/' , "$1\n" . $ this -> renderBanner ( ) , $ template , 1 ) ; }
Compiles a template using the given data.

@param string $template
@param array $data
@return string
Compiles a template using the given data .