Okay so I am developing an advanced framework in PHP using MVC and want to know the best way to format the Views with dynamic data to be parsed by the PHP.
Currently I am using this format:
Format of Controller loading a View
$vars = array();
$vars['EXAMPLE_TEXT'] = "Hello World!";
$this->load->View("view_name", $vars);
Where vars is an array of strings to be passed into the view using the key to identify it in the View.
Format of the "view_name" view.
<b>{EXAMPLE_TEXT}</b>
would just show the text: Hello World!
The problem
But as I am starting to use complex elements from databases (using foreach loops) I can not find a suitable syntax for the view, while keeping it nice for developers and keeping the speed of the parsing engine in PHP.
I was thinking of using a DTD or Schema style but I would really like to hear any input.