getkirby-v2 / toolkit

This is the deprecated toolkit for Kirby v2.
http://getkirby.com
81 stars 50 forks source link

Allow the `attr()` function to handle multiple values #162

Closed dweidner closed 8 years ago

dweidner commented 8 years ago

In my kirby patterns I like to keep my html classes organized within arrays, which makes it easier to filter undesired classes. It would be useful to allow users to pass such kind of arrays to the attr() helper function as it reduces the amount of required code:

Following an example:

Before:

<nav <?php echo attr('class', implode(' ', ['navbar', 'navbar--justify'])); ?>>
   <!-- … -->
</nav>

After:

<nav <?php echo attr('class', ['navbar', 'navbar--justify']); ?>>
   <!-- … -->
</nav>
dweidner commented 8 years ago

Args, a pity it is still not possible to change the target branch of a pull request (https://github.com/isaacs/github/issues/18). I will reopen it on the dev-branch. Sorry for the trouble.