public function markRequired($elTpl, $required)
    {
        if ($required) {
            $this->hasRequired = true;
            $elTpl = str_replace(array('<qf:required>', '</qf:required>'),
                                  array('', ''), $elTpl);
        } else {
            $elTpl = preg_replace('!<qf:required>.*</qf:required>!isU', '', $elTpl);
        }
        return $elTpl;
    }
public function markRequired($elTpl, $required)
    {
        if ($required) {
            $this->hasRequired = true;
            $elTpl = str_replace(array('<qf:required>', '</qf:required>'),
                                  array('', ''), $elTpl);
        } else {
            $elTpl = preg_replace('!<qf:required>.*</qf:required>!isU', '', $elTpl);
        }
        return $elTpl;
    }
public function markRequired ( $ elTpl , $ required ) { if ( $ required ) { $ this -> hasRequired = true ; $ elTpl = str_replace ( array ( '<qf:required>' , '</qf:required>' ) , array ( '' , '' ) , $ elTpl ) ; } else { $ elTpl = preg_replace ( '!<qf:required>.*</qf:required>!isU' , '' , $ elTpl ) ; } return $ elTpl ; }
Marks element required or removes "required" block

@param    string  Element template
@param    bool    Whether element is required
@return   string  Template with processed "required" block
Marks element required or removes required block