i'm trying to create a table view helper in Zend Framework , it takes an array of models and generate an html table that displays the model properties.
The user can add extra columns to display operations like update ,delete models ,.
so the user can add a string like that
$columnContent = '<a href=\'update/$item[id]\'>update</a>' ;
note that i use simple quotes to cache the string to be evaluated later
my problem is , is there a way to evaluate that string in a context , later on ?
so i need to mimic the " " behavior of strings in Php , thanks.
something like :
// in the context , where $item is a row of an array of models :
$myVar = evaluatemyString($columnContent);
EDIT :
i'm not looking for the eval function which doesnt work in my case , ( i think ).
EDIT 2 :
i need to put the result of the in a variable too.