Location: PHPKode > projects > Agile Toolkit > atk4-atk4-addons-5a69383/formandsave/lib/FormAndSave.php
<?php
namespace formandsave;
class FormAndSave extends \Form {
    function init(){
        parent::init();
        $this->addSubmit('Save');

        $f=$this;
        $this->api->addHook('post-init',function() use($f){
            if($f->isSubmitted()){
                $f->update();
                $f->js()->univ()->successMessage('Saved')->execute();
            };
        });
    }
}
Return current item: Agile Toolkit