The problem is that actions supposed to be served by AbcController are caught by SoftwareController. When I specify the URL as example.com/software/abc/index, the SoftwareController engages and tries to handle the abc action (and fails of course).
The question is: how do I make Yii figure out that software/index is to be served by SoftwareController, and software/abc/* by software/AbcController?
Thanks bettor, but this is not the solution I’m looking for. I want to keep my URL clean and structured the same way the site content is organised, otherwise you’ll end up with hundreds of controllers in the controllers/ folder.
Ah please forgive my negligence. so software/ folder is a subfolder of controllers/ right? Ok I first thought that they are at the same level. In your case I suspect that the problem is that your subfolder has the same name as an actual controller file. So a good solution would be to name your subfolder uniquely!
That’s also not an option. The idea is that there’s the software/index action, which is shortened to software/, and further product pages software/abc, software/def etc. (those are handled each by a dedicated controller).
Models not, they are used across the site and thus don’t require a hierarchical organisation.
Views yes, that’s also how Yii handles them by default, isn’t it? For instance, controller controllers/abc/DefController looks for views in views/abc/def.
I want the structure of the website to follow the organisation of information. Which is hierarchical, and this is standard on many websites. So when you open example.com/software/ you get a Software title page, and example.com/software/productA shows you info about Product A.