Winter CMS resources and help articles

Simple and to the point. Optimized by the community.

Access Post upload data from AJAX handler

0
by mjauvin, last modified on April 5th, 2022
    public function onPreview()
    {   
        // using the formController
        $model = $this->formCreateModelObject();
        $this->initForm($model);
        $form = $this->formGetWidget();
        $sessionKey = $form->getSessionKey();
        $photos = $model->photos()->withDeferred($sessionKey)->get();

        // manually using the Input data
        $model = new Land(Input::get('Land'));
        $sessionKey = Input::get('_session_key');
        $photos = $model->photos()->withDeferred($sessionKey)->get();
    }

Discussion

0 comments

We use cookies to measure the performance of this website. Do you want to accept these cookies?