Bootstrapper\Form::text PHP Method

text() public method

public text ( string $name, string | null $value = null, array $attributes = [] ) : string
$name string The name of the text input
$value string | null The default value
$attributes array The attributes of the input
return string
    public function text($name, $value = null, $attributes = array())
    {
        $attributes['class'] = isset($attributes['class']) ? self::FORM_CONTROL . ' ' . $attributes['class'] : self::FORM_CONTROL;
        return parent::text($name, $value, $attributes);
    }

Usage Example

 public function testPrependAppend()
 {
     $html = Form::prepend_append(Form::text('inputfoo'), '$', '.00');
     $matcher = array('tag' => 'input', 'attributes' => array('type' => 'text', 'name' => 'inputfoo', 'id' => 'inputfoo'), 'parent' => array('tag' => 'div', 'attributes' => array('class' => 'input-append'), 'child' => array('tag' => 'span', 'attributes' => array('class' => 'add-on'), 'content' => '$'), 'descendant' => array('tag' => 'span', 'attributes' => array('class' => 'add-on'), 'content' => '.00')));
     $this->assertTag($matcher, $html);
 }
All Usage Examples Of Bootstrapper\Form::text