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. :(
public $values = array();
public function set($key, $value)
$this->values[$key] = $value;
public function parse()
Breath between sentences, it'll help us understand the question.
If you don't want to include that class in a separate file, why not copy and paste it into the file you want to use it from? Or as part of another library file in your arsenal?
i have the controller class (which is extended by each controller), the controller is an abstract class with a final function index in there i have a function that is called before anything else from where i check for headers setup header parse each bit of template header body(controller) footer(each of this accept the controller are defined in a config file for templates) and of course before parsing the template files i need to run the parse() function but as i've mentioned i have troubles at this part.
I don't want to add there this two functions and i keep them separated because in the future i might add new things or change things around there.. and i want to keep everything in it's own class not mix up things.
(that function i have in the controller class is called by the router class).
so the flow would be something like this http://www.domain.com/ -> check for headers "parse" the $vars from template load the bits call controller -> method ( i think... i`m kinda of tired in this moment prob my judge is not very good :( )