zendframework/zf2 — pull request #6709 by nikolaposa (2014-09-27 18:45:32+00:00)
Title: HtmlTag helper

New view helper used for rendering `` tag of a web page, to which some custom attributes can be added dynamically.

## Intent
Idea is to have ability to dynamically attach some attributes to the opening HTML tag in a layout. For example:
``````

## Usage
Rendering tag in a layout:
```php
echo $this->html()->openTag();
//...
echo $this->html()->closeTag();
```

Adding attributes:
```php
//single
$this->html()->setAttribute('xmlns', 'http://www.w3.org/1999/xhtml');

//multiple
$this->html()->addAttributes(array(
'xmlns' => 'http://www.w3.org/1999/xhtml',
'prefix' => 'og: http://ogp.me/ns#'
));

//shortcut method
$this->html(array(
'xmlns' => 'http://www.w3.org/1999/xhtml',
'prefix' => 'og: http://ogp.me/ns#'
));
```