SimpleForm::attachLabelBySelector PHP Method

attachLabelBySelector() public method

Used by the page object to set widgets labels to external label tags.
public attachLabelBySelector ( SelectorInterface $selector, $label )
$selector SelectorInterface Criteria to apply.
    public function attachLabelBySelector(SelectorInterface $selector, $label)
    {
        for ($i = 0, $count = count($this->widgets); $i < $count; $i++) {
            if ($selector->isMatch($this->widgets[$i])) {
                if (method_exists($this->widgets[$i], 'setLabel')) {
                    $this->widgets[$i]->setLabel($label);
                    return;
                }
            }
        }
    }