html template with php tag stored in database.

I do have html template with php tag stored in database. Now when I render the the view m getting the content from the database but the value for the php tag that which, I passed in view with an array is not getting like

eg.

in Controller

$databaseFiled = "select from database";

$this->render(‘view’, array(“model”=>find(), “field”=>$databaseFiled ))

in View.

<?php echo $databaseField ?> (dataBaseFiled = "<html>…<?echo $model->id?>…</html>)

here I am not getting the value for &#036;model-&gt;id.

So please help me find solution…

You have to use eval() then.


<?php eval('?>' . $databaseField . '<?php') ?>

(I don’t think it’s good practice, but sometimes we have no choice :) )

Thanks for Your relpy

it’s works just need to add space i.e.


<?php eval('?>' . $databaseField . '<?php ') ?>

but now got other issue

it says “Cannot modify header information - headers already sent by (output started at /home…);”????