Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Call dump() inside onFlexObjectAfterSave

Solved by Karmalakas View solution

Started by Daniel 5 years ago · 2 replies · 486 views
5 years ago

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

PHP
    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?

5 years ago

@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?

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 46 1 week ago
Plugins · by Xavier, 4 weeks ago
2 55 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1181 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 49 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 73 2 months ago