Jump to content

Allowing page->url to be hooked


pjg
 Share

Recommended Posts

I've been using pw successfully for a while now and for two of my recent projects I had to rewrite the page->url function. Since rewriting this in the actual core is not great for updates it would be great if the function would generally be made hookable. This allows for a more dynamic way of dealing with links and link rendering while, as far as I can see so far, not interfering with the actual functionality of the pw core.

For the time being I'm more than happy to add my 3 _ to it and with the next update do it again, but it would be useful if it was there anyway.

Link to comment
Share on other sites

You would instead hook Page::path. It' used by url and making url also hookable doesn't make sense and maybe even for performance reasons as it can be called many times in a request.

Or you could add your own url method to Page.

Link to comment
Share on other sites

For some reason hooking onto path didn't even cross my mind... sounds like the better idea though as url is dependent on path anyway and it would allow me to remove a workaround currently running for the admin pages.

  • Like 1
Link to comment
Share on other sites

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...