Ouzo\Helper\ModelFormBuilder::textField PHP Метод

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

public textField ( $field, array $options = [] )
$options array
    public function textField($field, array $options = array())
    {
        $attributes = $this->_generatePredefinedAttributes($field);
        $attributes = $this->_mergeAttributes($attributes, $options);
        return textFieldTag($this->generateName($field), $this->_object->{$field}, $attributes);
    }

Usage Example

Пример #1
0
 /**
  * @test
  */
 public function shouldNotAddEmptyClassAttribute()
 {
     //given
     $product = new Product(array('name' => 'valid'));
     $formBuilder = new ModelFormBuilder($product);
     //when
     $html = $formBuilder->textField('name');
     //then
     $this->assertNotContains('class="', $html);
 }