getkirby/toolkit — pull request #26 by mxlje (2014-10-27 10:41:50+00:00)
Title: Fix closing tags for bricks with no content

The second parameter to the `Html::tag` function (which the `Brick` class uses internally) should be `null` if the tag has no content, like an `` or `

` tag for example.

`$brick -> html()` currently returns `false` instead of `null` if the content is empty, which leads to the element being closed explicitly.

Example from the documentation:

```php
$img = brick('img');
$img->attr('src', 'http://yourdomain.com/someimage.jpg');
$img->attr('width', 300);
$img->attr('height', 200);
$img->addClass('image');

echo $img;
```

This currently prints

```html

```

but should print

```

```

This PR changes the `Brick` initializer and helper defaults to use `null` instead.