I have a custom module that implements a few new REST endpoints, which is working correctly.

In my api2.xml I have the routes defined as this:




And I have the appropriate _retrieve(), _retrieveCollection(), and _create() in the corresponding V1.php. All works as intended so far.

But... I need to add a new endpoint for this resource, hopefully handled by the same controller. It would also be a PUT/update (normally handled by _update()), but that I'd like to handle with a different method within my controller.

Basically, it comes down to either being able to specify a custom handler directly, something looking like:


Or at least to be able to pass an additional param through the route definition directly, something like:


I guess that I could check do something like always going through _update checking pathinfo and decide according to that... but it doesn't seem too clean.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.