changing haml templates to php