public function setStrainerText($callable = null, $attr = []) { // if callable is a string , it's a field if (is_string($callable) || $callable instanceof Expression) { $field = $callable; $callable = null; } // create the strainer $strainer = new Text($this, $callable, $attr); //if a fields is set, we configure the strainer if (isset($field)) { $strainer->setField($field); } return $this->setStrainer($strainer); }
/** * Render a striner for a text element * * @param Column\Strainer\Text $strainer * @return string */ public function strainerText(Column\Strainer\Text $strainer) { $element = $strainer->getElement(); $element->addStyle('width', '100%'); $element->addClass('text-center'); $element->addClass(Style::FORM_ELEMENT_CONTROL); return html('input', $element->getAttributes()); }