/** * @param string|Closure $content */ public function render($content) { if ($content === null) { $content = TextUtil::humanize($this->for); } elseif ($content instanceof Closure) { //FIXME: closure should receive a FormTag ob_start(); $content(); $content = ob_get_clean(); } return "<label {$this->getAttributes()}>{$content}</label>"; }
public function button($field, $value = null, $params = array()) { ++$this->_btn_count; if ($value === null) { $value = TextUtil::humanize($field); } return $this->input('button', $field . $this->_btn_count, array_merge(array('value' => $value), $params)); }