Jump to content

Recommended Posts

Posted

What is the $event variable/parameter in the Helloworld.module?

What does the $event?

How does it work?

Are there php classes which describes $event?

What are all these things doing?

$event

$event->arguments[0]

$event->object

Im sorry if this is a nooby question :)

Posted

$event is the HookEvent object, that's passed into each hooked function. It holds all the information needed about the hooked function, arguments, objects, return values and so on.

  • Like 2
Posted

You can also do a var_dump($event); die(); in the module to see its content

or use $event->return or $event->arguments if $event alone does not work

  • Like 3

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
×
×
  • Create New...