Usually if I wanted to create a page /user/profile i would create the function profileAction() in the User Controller.
Now if I want to create a page called /error/404 i can’t create a 404Action() because of the syntx error unexpected '404', expecting 'identifier'
Is there a way I can create pages with numbers like that?
Usually if I wanted to create a page /user/profile i would create the function
Share
One way would be to define a custom route as follows:
Than in your the indexAction you would forward to an action for a specific error code. For example, for 404 error:
This is very simplified example, but it should be enough to show how it could be done.
Another way, instead of forwarding, would be just to render appropriate view script, e.g.