Custom HTML editor

Hi,

What is the best templating language / solution to use in an application to allow the user to create mark up / insertion of "safe php" or some other dynamic mark up.

Basically I am making a system whereby I want the user to be able to edit the HTML markup from the admin panel. But it has got to allow the user to insert dynamic "php like" areas.

James.

So something like …





<html>


<body>


{foreach posts as post}

{post.title}<br />

{post.author}<br />

{post.content}<br />

{endforeach}


</body>


</html>




Check wordpress implementation