The first thing that comes to my mind is using smarty.  You can direct it to
use a database field instead of a file.  In which case, you'll have a new
set of issues to deal with which are related to passing the $html object
into the template.

Also, if you trust the code then you can do a few other things like using
the eval function 

eval($code);

or depending on your style you could write the code to a file then include
the file.

file_put_contents ('tempfile.tmp','<?php ' . $code . ' ?>');
include('tempfile.tmp');
?>

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of braincramp
Sent: Monday, March 08, 2010 1:49 PM
To: CakePHP
Subject: php in database

Hi, I have a CMS application and would like to include <?php echo
$html->link() ?> and other such tags inside the content of pages that
are stored in the database. However, when I view the pages, the php
tags are displayed as text. Is there a way to parse PHP code from
database content in a view?

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

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

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to