I have a bunch of pages that are really just html - they don’t have any content from models in them. Currently I have an action for each of them in the controller that just looks like
public function myaction() { }
public function myotheraction() { }
etc.
It feels like there must be a neater way of doing this so that any action that doesn’t need the controller to do anything just gets forwarded to the right view rather than having a series of actions that aren’t doing very much.
Have you seen the display() method in PagesController in the Cakephp 4.3 skeleton app? I think that does what you are looking for.
As noted in the documentation here, “[i]f you make the view file templates/Pages/about_us.php you can access it using the URL http://example.com/pages/about_us”.
If you don’t want ‘pages’ in the url, you could always add some custom routes which point to that display() method.