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

Admin Event Hook for Flex Object

Started by Christiana 5 years ago · 3 replies · 704 views
5 years ago

Hello!

Can you give me the correct Admin Event Hook that I can use to intervene when saving Flex Objects to extend the functionality in my plugin? The "onAdminSave" event does not work for me at this point.
I am looking forward to help!

Greetings, Christiana

5 years ago

I think I found it. It is onFlexAfterSave(), right?

4 years ago

@gdrgdr : I used onFlexAfterSave() function to solve my issue.

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

    /**
     * When flex object is saved
     */
    public function onFlexAfterSave(Event $event)
    {
        $type = $event['type'];
        $object = $event['object'];
        //set commit message for flex objects
        if($type === 'flex'){
            //my functions here
        }
    }
4 years ago

@christiana83, Thanks for the follow up on you own question.

NB. The reply you respond to is however being flagged as spam.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 44 1 week ago
Plugins · by Xavier, 4 weeks ago
2 54 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 48 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 73 2 months ago