Custom HTML editor


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.


So something like …



{foreach posts as post}

{post.title}<br />

{}<br />

{post.content}<br />




Check wordpress implementation