Compile templates to a php class