Jump to content

[solved]Hooks: changing url in before hook


benbyf
 Share

Recommended Posts

Really confused about how hooks work. I'm trying to use $wire->addHookBefore("Pages::published", function(HookEvent $event) { ... } to get and change the page url before it is published how not found any way of passing the changed back. E.g.

 

$page = $event->arguments(0);
$page->name = "somename";
// now what to save the data??

my understanding is I can't use $event->return on a before hook, so how do i propergate the change? Or should I be hooking onto a function that happens before the published function is called?

Link to comment
Share on other sites

  • benbyf changed the title to [solved]Hooks: changing url in before hook

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...