Created
June 28, 2013 01:40
-
-
Save Ruxton/5881840 to your computer and use it in GitHub Desktop.
The most useful Rails template handler this side of Kepler-69.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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