render php code from database

I tried to render php code from database,

I used renderText, eval, but didn’t help

This is the code that I saved into database.

<h1><?php echo Yii::t('its','TEST HEADER');?></h1>

Any idea how to overcome this issue



won’t work in this case, as described at

So, you would need to have something like:

$code = "?><h1><?php echo 'Hello there'; ?></h1>";


The important thing to notice is the closing PHP tag before the first <h1> tag.

it works thanks mate