public static function textArea($name, $value = '', $htmlOptions = array()) { // In case we do need to create a div container for the text area $containerOptions = array(); // Get the intended input width before the rest of the options are normalized self::addSpanClass($htmlOptions); self::addColClass($htmlOptions); $col = self::popColClasses($htmlOptions); $htmlOptions = self::normalizeInputOptions($htmlOptions); self::addCssClass('form-control', $htmlOptions); $output = ''; if (!empty($col)) { self::addCssClass($col, $containerOptions); $output .= self::openTag('div', $containerOptions); } $output .= parent::textArea($name, $value, $htmlOptions); if (!empty($col)) { $output .= '</div>'; } return $output; }
public function testTextArea() { $I = $this->codeGuy; $html = TbHtml::textArea('textarea', 'Textarea text', array('class' => 'textarea')); $textarea = $I->createNode($html, 'textarea'); $I->seeNodeAttributes($textarea, array('class' => 'textarea', 'id' => 'textarea', 'name' => 'textarea')); $I->seeNodeText($textarea, 'Textarea text'); }