We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Html style attributes are simpler than attribute hashes. See below what they can do.
Can be stretched across multiple lines
Just like hash-style attributes. The follow HamlPHP snippet
%script(type="text/javascript" src="javascripts/script_#{2 + 7}")
will compile to
<script type="text/javascript" src="javascripts/script_<?php echo 2 + 7; ?>" />
Variables can be used by omitting the quotes
%a(title=$title href=$href) Stuff
compiles to
<a <?php atts(array('title' => $title, 'href' => $href)); ?>>Stuff</a>
Can be written just like HTML:
%input(selected)
compiles to:
<input selected="selected"></input>
But more complicated expressions aren’t allowed.
For those you’ll have to use the {} syntax. You can, however, use both syntaxes together.
%a(title=$title){href => $link->href} Stuff
<a <?php atts(array('title' => $title, 'href' => $link->href)); ?>>Stuff</a>