Added ability to execute template functions from PHP code