Hello
I need a controller for my dashboard to have access to other controllers like PostsController.
i want the admin to be able to add, delete and do any action on any controller. how can i do this?
Sounds like you want a /admin url where you can access posts? One way to achieve that is through prefix routing.
https://book.cakephp.org/3.0/en/development/routing.html#prefix-routing
You will want to secure it in your beforeFilter in some way.
thank you xaphalanx.
i did prefix routing and i have one more question. i added admin prefix on UsersController, now can i get access to other controllers like PostsController and CommentsController through this /admin . I mean can i add or remove a post or a Comment or it just works for users. i want to have a dashboard to have full control on all the dynamic content. when a new post or comment is coming, i want it to be confirmed by admin then publish on my web application and limit the time a post is on my website. how can i have this full access and control?
You’re writing the code. You decide how you want it.
I’d have one set of controllers in /admin that’s just for “full control” and another more restricted set of controllers for my users.