mervick / yii2-mthaml

The MtHaml integration for the Yii2 framework.
MIT License
8 stars 1 forks source link

Cannot use nested attributes: HTML5 Custom Data Attributes #5

Open starrychloe opened 9 years ago

starrychloe commented 9 years ago

According to HAML spec,

http://haml.info/docs/yardoc/file.REFERENCE.html#html5_custom_data_attributes

this should be allowed

%button.btn.btn-success{data: [toggle: "collapse", target: "#newAd"]} Create Ad

This didn't work either:

%button.btn.btn-success{:data => [:toggle => "collapse", :target => "#newAd"]} Create Ad

This didn't work either:

%button.btn.btn-success{data: {toggle: "collapse", target: "#newAd"}} Create Ad

Error:

syntax error, unexpected ':', expecting ']'

<button <?php echo MtHaml\Runtime::renderAttributes(array(array('class', ('btn' . ' ' . 'btn-success')), array('data', ([toggle: "collapse", target: "#newAd"]))), 'html5', 'UTF-8'); ?>>Create Ad</button>