protected function AddSubmit($name = '', $label = '')
    {
        $defaultLabel = $this->Label('Submit');
        if (!$name)
        {
            //html attributes better without dot
            $name = str_replace('.', '-', $defaultLabel);
        }
        if (!$label)
        {
            $label = Worder::Replace($defaultLabel);
        }
        $this->triggerName = $name;
        $field = new Submit($name, $label);
        $this->Elements()->AddField($field);
        return $field;
    }
protected function AddSubmit($name = '', $label = '')
    {
        $defaultLabel = $this->Label('Submit');
        if (!$name)
        {
            //html attributes better without dot
            $name = str_replace('.', '-', $defaultLabel);
        }
        if (!$label)
        {
            $label = Worder::Replace($defaultLabel);
        }
        $this->triggerName = $name;
        $field = new Submit($name, $label);
        $this->Elements()->AddField($field);
        return $field;
    }
protected function AddSubmit ( $ name = '' , $ label = '' ) { $ defaultLabel = $ this -> Label ( 'Submit' ) ; if ( ! $ name ) { //html attributes better without dot $ name = str_replace ( '.' , '-' , $ defaultLabel ) ; } if ( ! $ label ) { $ label = Worder :: Replace ( $ defaultLabel ) ; } $ this -> triggerName = $ name ; $ field = new Submit ( $ name , $ label ) ; $ this -> Elements ( ) -> AddField ( $ field ) ; return $ field ; }
Adds a submit button that triggers the form logic on submit
@param name The button name; if omitted, a name is generated by bundle and module name
@param label The visible button label; if omitted, a label is generated
@return Submit Returns the added submit button
Adds a submit button that triggers the form logic on submit