protected function compile($template, $data)
    {
        foreach($data as $key => $value)
        {
            $template = preg_replace("/\\$$key\\$/i", $value, $template);
        }
        return $template;
    }
protected function compile($template, $data)
    {
        foreach($data as $key => $value)
        {
            $template = preg_replace("/\\$$key\\$/i", $value, $template);
        }
        return $template;
    }
protected function compile ( $ template , $ data ) { foreach ( $ data as $ key => $ value ) { $ template = preg_replace ( "/\\$$key\\$/i" , $ value , $ template ) ; } return $ template ; }
Compile the template using the given data.

@param $template
@param $data
@return mixed
Compile the template using the given data .