I can do the admin_edit
, admin_delete
, admin_print
and admin_manage_tags
actions on an ArticlesController
, those actions will require an $id
passed. I can also do admin_create
or admin_sort
without an $id
. Finally, admin_delete
will require POST
, all others should use GET
.
How and where do I store all those rules in CakePHP in a way so I can easily access or update them all and have the corresponding action links renderd on the items list page, the edit page, or anywhere else automatically?
For example, I have a list page of all articles (admin_index
), and would like to render the direct links to the editing or printing pages. I know I can hardcode them, but if I add some new functionality, such as admin_render_pdf
, I'd have to go through all views and put it there manually. Same if I rename or remove an action.
Furthermore, having a common source of all admin actions could even allow me to render the admin navigation automatically.
Do I define an array somewhere manually, or does CakePHP have some magic that'd retrieve those for me? What is the commonly used / best practice in this case?
The closest I could find was this list-all-controllers-actions-in-cakephp-3 but it looks like it's mostly ACL-related.