Creating Dynamic Views


I'm trying to store the full content of a view within a database and then just call that content when the view is invoked.  The problem is that not all tags are showing properly. I'm not sure how to call the information.  For example, if I use something like:

<?php echo CHtml::label($content,'cont'); ?>

and $content comes from a database and contains

<p>Just a test</p>

<?php echo 'hello';?>

the output does not process the php code.  I tried it with CHtml::encode, however it created other problems.

Any suggestions?


You need to use eval() since it contains PHP code.

Thanks Qiang.  I have used eval() in the past, but thought there might be something specific built into Yii that reads the markup identical to what is in a view file.  Eval requires slight change to the markup, which is fine.