03-24-2010, 09:28 PM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 7
Thanks: 0
|
small template engine
hello i`m trying to build a small simple parser data from controller to the view but i`m including my files using another function in another class and i would like to use the parse function from bellow code there but without including the file from the parser function i want to include it separated but i can't succeed in doing that can someone please help me i can't figure out by my self why i can't do that. :(
PHP Code:
class View
{
public $values = array();
public function set($key, $value)
{
$this->values[$key] = $value;
}
public function parse()
{
if(is_array($this->values))
{
extract($this->values, EXTR_OVERWRITE);
}
include('index.php');
}
}
|
|
|
|