Q:

Is there a way to store a call to various PHP functions in a MySQL database without the risks of using eval()?

I'm building a very basic CMS for a specific project that contains numerous functions such as get_menu(), get_title(), get_recent(), etc.  However, I want to be able to store templates, which would be echoed during page load, that contain said functions in the MySQL database.
Doing a str_replace for each possible function would be a pita and I realize that using eval() is at times dangerous.  Is there a better, more efficient way to go about doing this?  I'm pretty sure it can be done as this is how templates are set up in Textpattern.

A:

For the reason you mention, I think you're better off using Smarty or some other templating language. If you want to load your templates dynamically, just store the filenames instead.

