Closed ezekg closed 10 years ago
Perhaps you could use a helper, something like:
def php text
"<?php echo #{text}; %>"
end
Then you could use it like this:
%a{:href => php("$user") }
which would then generate (you will need to turn off attribute escaping):
<a href='<?php echo $user; %>'></a>
Good idea. I ended up creating a custom Guard/shell script to compile Haml from the command line using PHamlP. Much nicer, as I can write vanilla Haml and have it compile to PHP instead of Ruby.
Is there some way that HAML could allow inline filters? Or is there a way for me to do this right now that I'm missing?
Right now, HAML thinks I'm passing the entire line
":php => $user"
as the filter name.