SE7ENSKY / jade2php

Unlock Jade for PHP! Convert Jade templates into raw PHP templates. CLI tool and JavaScript API. Test covered.
43 stars 10 forks source link

Add a default "null" value to mixin arguments #17

Closed czert closed 9 years ago

czert commented 9 years ago

I added a default null value to arguments in mixin function definition, so that the mixins can be called with some arguments missing, just like in jade.

Also, I believe that both the test and code for "rest arguments" was wrong (test/renderer.test.coffee:311), the offset argument to array_slice needs to be equal to the number of mixin arguments + 2. Fixed that along with updated tests to reflect the above change.

Let me know what you think.

ivankravchenko commented 9 years ago

Definitely agree. Merged with added tests. Also added you as collaborator. Thank you for contributions.