i want divide the controllers in controller folder in two different folders:
what i want is:
\controllers
\folder1
ExampleController.php
\folder2
TestController.php
instead of:
\controllers
ExampleController.php
TestController.php
Thanx in advance…
Keith
(Kburton)
January 28, 2015, 12:23pm
2
You can already do that, but your URL will become ‘example.com/folder1/example/action ’.
If you don’t want to show ‘folder1’ in the URL, you need to add URL rules for each controller.
Keith:
You can already do that, but your URL will become ‘example.com/folder1/example/action ’.
If you don’t want to show ‘folder1’ in the URL, you need to add URL rules for each controller.
thanx
but if i seperated controllers and try to access like
appdirectory/index.php/folder1/example/admin
it is showing an error
ExampleController cannot find the requested view "admin"
i think there should be some changes in config file regarding changing the path of controller which i am missing…
Keith
(Kburton)
January 28, 2015, 1:32pm
4
The routing is working, it’s the view file that’s not loading in your render call.
Try making sure that the view folder structure mirrors the controller folder structure. Alternatively, specify the view to render using a full path.
thank you very much…
i changed view files path too… now its working…
Do any other error will occur??I mean,Do i need to change any other paths or any other setting??..
Keith
(Kburton)
January 30, 2015, 8:03am
6
No. Just make sure that any links use the correct path.
ok…thank you…
same way if i seperate out the models then do i need to use mirror folder structureas view and controller??
Keith
(Kburton)
January 30, 2015, 11:12am
8
The location of the models is irrelevant. You just need to make sure that the files can be automatically imported. The easiest way is to add your paths to the import array in your application config.
phtamas
(Phtamas)
January 30, 2015, 12:18pm
9
Seems like you’re working on reinventing modules.