Call dump() inside onFlexObjectAfterSave

How can I call the dump () function inside the onFlexObjectAfterSave () function?

    public static function getSubscribedEvents() {
        return [
            'onFlexObjectAfterSave' => ['onFlexObjectAfterSave', 0],
        ];
    }

    public function onFlexObjectAfterSave($event)
    {
        $path= $this->grav['uri']->paths(1);

        if($path == "data-table"){
            $object = $event['object'];
            dump($object);
            $this->grav['debugger']->addMessage('-----------------------------------------');
            $this->grav['debugger']->addMessage($object);
            $this->grav['debugger']->addMessage('-----------------------------------------');
        }
    }

Is there a way to pause the grav before redirecting after saving? To display the result of the dump function?

die();

? :sweat_smile:

@danielkoptak,

Is there a way to pause the grav before redirecting after saving? To display the result of the dump function?

Isn’t that exactly what XDebug is created for: Pause on breakpoints and examining variables?

die() is a bit coarse don’t you think?