I am working on template engine similar to asp.net one.
Here is sample of syntax:
Code: Select all
<PHP:Panel ID="myPanel" Title="My Panel">
</PHP:Panel>
To make this tag to work class PHP_Panel must be defined like this
Code: Select all
class PHP_Panel extends BaseControl
{
public $Title
function Render()
{
//Render panel here
}
}
I was looking for solution to bind propoerty with variable like:
Code: Select all
<PHP:Panel ID="myPanel" Title="{title}">
</PHP:Panel>
Title = "{title}" is assings a variable to property, this is evaluted when requested
using current DataRow.
This is also completed but i have to change all Public declaration to Protected and
override __call, __set and __get. I tought that this solution would be slow but i don't see any performance loss.