hattr() публичный Метод

- Handles boolean attributes. - Omits empty attributes if not forced by appending '!' to the name. - JSON encodes array values - Prettied output of class attribute and array data is handled.
public hattr ( array $attributes ) : string
$attributes array
Результат string Attributes
Пример #1
0
 public function testHattr()
 {
     $app = $this->getApp();
     $handler = new AdminHandler($app);
     $attributes = ['class' => 'info-pop fa fa-info-circle', 'data-content' => ['gum', 'leaf'], 'data-title' => 'clippy', 'checked' => true, 'name+id' => 'koala'];
     $result = $handler->hattr($attributes);
     $this->assertSame(' class="info-pop fa fa-info-circle" data-content="["gum","leaf"]" data-title="clippy" checked name="koala" id="koala"', $result);
 }