label() 공개 메소드

Returns Bootstrap label markup. By default, uses .
public label ( string $text, array $options = [] ) : string
$text string Text to show in label.
$options array Additional HTML attributes.
리턴 string HTML icon markup.
예제 #1
0
 public function testLabel()
 {
     $result = $this->Html->label('foo');
     $expected = ['span' => ['class' => 'label label-default'], 'foo', '/span'];
     $this->assertHtml($expected, $result);
     $result = $this->Html->label('foo', 'warning');
     $expected = ['span' => ['class' => 'label label-warning'], 'foo', '/span'];
     $this->assertHtml($expected, $result);
     $result = $this->Html->label('foo', ['type' => 'custom']);
     $expected = ['span' => ['class' => 'label label-custom'], 'foo', '/span'];
     $this->assertHtml($expected, $result);
 }