How to create a pop-up window with yes/no buttons in a model

There is an import model in which a custom parameter is added

        label: reset autoincrement
        type: checkbox
        default: false


class PageImport extends \Backend\Models\ImportModel
    public function importData($results, $sessionKey = null)
        if ($this->reset_autoincrement) {
            // create form yes/no


as with reset_autoincrement == true
show pop-up window with yes/no buttons and get button click result?

If I understand your question correctly, I would create a form widget for this:

You then may use a modal to display your pop-up window:

I never used the ImportModel class, but I guess, you could use it then in your form widget.

1 Like