Jump to content

Recommended Posts

Posted

How do I hook into a protected method from my module? Example, Pages::saved(). This is defined as:

protected function ___saved(Page $page) { }

This is how my module is implemented:

class PageContentFlow extends WireData implements Module{
....
}

is it possible?

Posted

Guessing from your question you haven't tried... :) but yes you can? Protected function also are hookable, but not directly callable as a member function outside the class. It would make no sense to have save hookable indicated by the three underscores, if it wouldn't work.

Posted

thanks Soma. yeah, actually I already did try, I wanted to hook to Pages::saved() and had typed Page::saved() instead, which led to a lot of head banging.. :biggrin:

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
  • Recently Browsing   0 members

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