We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Slimming / structuring down admin controller

Hi,

I am creating an admin area for my site. Currently I will need to manage products, catrgories, orders and users. How would I structure the app, to use:

https://www.domain.com/admin/

Basically I don't want to have a really big admin controller so want the admin area to be strutured as:

Product section

List all: https://www.domain.com/admin/products

Edit / View: https://www.domain.com/admin/products/1

Users section

List all: https://www.domain.com/admin/users

Edit / View: https://www.domain.com/admin/users/1

so each controller mangages their specific sections, and not just one big controller.

Thanks



43.9k

Hi,

yes you can use one controller for each model you have got. PhalconDevTools can help you to build (build model, controller and the associated views) these basic CRUD operations wich you will be able to customize to fit your needs.

To handle your controllers actions the way you want, phalcon's router is your friend, and for your problematic group of routes could be really usefull.