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

Sub controller can not find appropriate view

Hi

I want to use Simple-Subcontrollers example here: https://github.com/phalcon/mvc#phalcon-mvc-examples

I have a sub directory name 'admin' and a controller named 'FmController'.

The problem is when i browsing /sample/admin/fm, the dispatcher find FmController but it looking in /views/fm/index.phtml instead of /views/admin/fm/index.phtml.



85.5k

i dont think there is a thing "sub controller" in phalcon as far as i know

edited Sep '16

here it is https://github.com/phalcon/mvc#simple-subcontrollers

i dont think there is a thing "sub controller" in phalcon as far as i know



85.5k
edited Sep '16

they extend Phalcon\Mvc\Controller; which is the same, you can put your controllers in /toto dir fi you want they will still be controllers :D . But maybe i am wrong, doesnt matter as you can see here those sub-controllers actually change the views directory so that your logic can work

Did you do that ?