Well thats terrible practice. Do not save PHP code within the
database, nor use eval().

On Sep 14, 5:06 am, djogo <djogopat...@gmail.com> wrote:
> That's exactly the point, I want it to be in a database column, and
> allow the end-user to edit it. Therefore, $test would keep a HTML/RTF
> document with tags <?=?>.
>
> I want to get it, perform variable substitution, and then e-mail it,
> or save it in another database column, but I just don't want to
> display it.
>
> dfcp
>
> On Sep 13, 12:43 pm, brian <bally.z...@gmail.com> wrote:
>
>
>
>
>
> > 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 <djogopat...@gmail.com> 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 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