Last active
August 29, 2015 13:57
-
-
Save telekineticyeti/9773632 to your computer and use it in GitHub Desktop.
A simple HAML PHP Filter for middleman.
This file contains hidden or 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
module Haml::Filters::Php | |
include Haml::Filters::Base | |
def render(text) | |
<<END | |
<?php | |
#{text.rstrip.gsub("\n", "\n ")} | |
?> | |
END | |
end | |
end | |
# Reference this file in your Middleman project's config.rb: | |
# require 'phpfilter' | |
# | |
# Use 'php:' to invoke filter. All following indented code will be wrapped in <?php ?> tags | |
# | |
# Example: | |
# | |
# php: | |
# phpinfo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment