public function prepare(Session $session = null, bool $is_root_form = true)
    {
        foreach ($this->form_elements as $field)
        {
            if ($field instanceof Form)
                $field->prepare(null, false);
        }

        $params = ['form' => $this, 'session' => $session, 'is_root_form' => $is_root_form];
        $params = TypedDictionary::wrap($params);
        Hook::execute('Wedeto.HTTP.Forms.Form.prepare', $params);

        if ($is_root_form)
            $this->form_elements['_form_name'] = new FormField('_form_name', Type::STRING, "hidden", $this->name);

        return $this;
    }
public function prepare(Session $session = null, bool $is_root_form = true)
    {
        foreach ($this->form_elements as $field)
        {
            if ($field instanceof Form)
                $field->prepare(null, false);
        }

        $params = ['form' => $this, 'session' => $session, 'is_root_form' => $is_root_form];
        $params = TypedDictionary::wrap($params);
        Hook::execute('Wedeto.HTTP.Forms.Form.prepare', $params);

        if ($is_root_form)
            $this->form_elements['_form_name'] = new FormField('_form_name', Type::STRING, "hidden", $this->name);

        return $this;
    }
public function prepare ( Session $ session = null , bool $ is_root_form = true ) { foreach ( $ this -> form_elements as $ field ) { if ( $ field instanceof Form ) $ field -> prepare ( null , false ) ; } $ params = [ 'form' => $ this , 'session' => $ session , 'is_root_form' => $ is_root_form ] ; $ params = TypedDictionary :: wrap ( $ params ) ; Hook :: execute ( 'Wedeto.HTTP.Forms.Form.prepare' , $ params ) ; if ( $ is_root_form ) $ this -> form_elements [ '_form_name' ] = new FormField ( '_form_name' , Type :: STRING , "hidden" , $ this -> name ) ; return $ this ; }
Prepare the form for rendering. This will generate the nonce and add the form name
@param Session $session The session used to generate the nonce. Omit to skip adding a nonce
@param bool $is_root_form Whether this is the root form or not. When
false, the _form_name element is not added
@return Form Provides fluent interface
Prepare the form for rendering . This will generate the nonce and add the form name