Skip to content

Instantly share code, notes, and snippets.

@Ruxton
Created June 28, 2013 01:40
Show Gist options
  • Save Ruxton/5881840 to your computer and use it in GitHub Desktop.
Save Ruxton/5881840 to your computer and use it in GitHub Desktop.
The most useful Rails template handler this side of Kepler-69.
class PHPHandler
def call(template)
php = `echo "#{template.source}" | php`.html_safe.inspect
end
end
ActionView::Template.register_template_handler(:php, PHPHandler.new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment