1

I am trying to modify array before create:

'beforeCreate' => function($postData){  
    $postData['slug'] = Event::slugify($postData['name']); 
    return $postData;},

In Grid, but it doesn't seems to work.

when I print $postData I can see it on array but is not inserting in database, slug is still empty.

flakerimi
  • 2,580
  • 3
  • 29
  • 49

1 Answers1

1

Because this is an event. You can't change data in event. Event is used to do some actions on that event. If you want to change date, use filter: createFilter. It is described in the documentation: https://www.impresspages.org/docs/grid

have a nice weekend. Cheers!

Mangirdas Skripka
  • 1,647
  • 1
  • 15
  • 14