public function __invoke(Tag $tag, Renderer $renderer) { if ($tag instanceof Form) { $tag->addClass('form-horizontal'); } if ($tag instanceof AbstractWidget && !$tag instanceof Group && $tag->getLabel() && $tag->getInput()) { $tag->getLabel()->addClass('col-sm-3'); $tag->getInput()->wrap('<div class="col-sm-9">', '</div>'); if ($tag->getHint()) { $tag->getHint()->addClass('col-sm-9 col-sm-push-3'); } } return $tag; }
public function __invoke(Tag $tag, Renderer $renderer) { if ($tag instanceof AbstractWidget && $tag->getInput()) { $this->addInputIdAttribute($tag, $renderer); $this->addLabelForAttribute($tag, $renderer); } return $tag; }
protected function addInputClass(Tag $tag) { $input = $tag->getInput(); // if input but not radioset or checboxset if ($input instanceof Input && !$input instanceof Radioset && !$input instanceof Checkboxset) { $input->addClass('form-control'); } elseif ($input instanceof Radioset || $input instanceof Checkboxset) { // for items with less then 4 items the list is inline if (4 > count($tag->get('_element')->get(Specs::OPTIONS))) { $input->addClass('list-unstyled'); } else { $input->addClass('list-inline'); } } }