This is a bit confusing. Why are you setting the variable $test in the first place? Just put:
<p>Hello, <b><?=$destinatary[Person][name]?></b> ... in your view. On Sat, Sep 12, 2009 at 9:33 AM, djogo <[email protected]> wrote: > > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
