public function input($type, $name, $value = null, array $attributes = array())
 {
     if ($type === 'submit') {
         $attributes['class'] = 'button';
     }
     return Html::input($type, $name, $value, $attributes);
 }
示例#2
0
 public function testRowWithValue()
 {
     $token = '12345';
     $this->row->setValue($token);
     $expected = Html::input('hidden', 'token', $token);
     $this->assertSame($expected, $this->row->render($this->renderer));
 }
示例#3
0
 public function input($type, $name, $value = null, array $attributes = array())
 {
     if ($type === 'submit') {
         //check for a btn (or button-type for compat with others?)
         //attribute, apply if it's set (primary, success, danger)
         //and unset from attributes
         $attributes = Html::addToAttributeArray($attributes, 'class', 'btn btn-primary');
     } else {
         $attributes = Html::addToAttributeArray($attributes, 'class', 'form-control');
     }
     return Html::input($type, $name, $value, $attributes);
 }
示例#4
0
 public function testTextareaContentIsEscaped()
 {
     $expected = '<textarea id="foo" name="foo">&lt;/textarea&gt;&lt;p&gt;Gotcha!&lt;/p&gt;</textarea>';
     $this->assertSame($expected, Html::input('textarea', 'foo', '</textarea><p>Gotcha!</p>'));
 }
示例#5
0
 public function input(RendererInterface $renderer)
 {
     return Html::input('hidden', $this->name, $this->value, $this->attributes);
 }
示例#6
0
 public function input($type, $name, $value = null, array $attributes = array())
 {
     return Html::input($type, $name, $value, $attributes);
 }
示例#7
0
 public function input(RendererInterface $renderer)
 {
     $attributes = $this->visible ? $this->attributes : array_merge(array('style' => 'display: none;'), $this->attributes);
     return Html::input('text', $this->name, $this->value, $attributes);
 }