Hello all,

The topic on Smarty remembered me of one issue I got.

Suppose I have a string like this:

$test = '<p>Hello, <b><?=$destinatary[Person][name]?></b>';

and I have a variable called $destinatary defined somewhere, and I
wish to substitute the substring (contained in $test)

<?=$destinatary[Person][name]?>

for the appropriated value that is into the variable $destinatary
['Person']['name'].

Is there any class on cakephp to do it? Yeah, I'm currently using
Smarty for that, it allows me to perform variable substitution not
only in "view" files, but also in strings.

And I feel that doing something like

eval( "\$return = \"$test\"; " );

is awfully dangerous, as $test actually comes from database, which is
set by the end-user.

The only way I though of doing that on Cakephp is by actually writing
the $test contents into a view and rendering it, but it's lame.

Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to