CodeIgniter Forums
How can I make a ResourceController ignore the show method? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: How can I make a ResourceController ignore the show method? (/thread-77525.html)



How can I make a ResourceController ignore the show method? - blaasvaer - 09-11-2020

Hi,

I don't like the 'show' method of the ResourceController – it seems redundant. I'd rather have my index show all or one based on whether a parameter is passed in or not. That's maybe just me. But how can I make this possible without getting into a HUGE fight with 'the way' CI 4 have chosen to handle this?

I'd basically like to avoid this:

Code:
error    "\"show\" action not implemented."

Is this possible or should I go back to just using a 'normal' controller and write it all myself, instead of ending up 'fighting' the framework?

I guess 'a lot' of decisions have been made in designing the resourcecontroller ... but if 'overriding' was part of it I don't know. Any ideas?


RE: How can I make a ResourceController ignore the show method? - tgix - 09-12-2020

https://codeigniter4.github.io/userguide/incoming/restful.html#limit-the-routes-made ?