[Closed] Codeigniter Will Not Load Default Route |
[eluser]riwakawd[/eluser]
Hello just a small issue codeigniter will not let me load my default route $route['default_controller'] = "admin/admin_login/administrator"; I have tried many ways but no luck? Very strange. To see full way I have done it can look at files here. https://github.com/riwakawebsitedesigns/ci-maintenance I have added MY_Router but still nothing. Still will not load default route.
[eluser]Massaki[/eluser]
First, you must be sure that your controller path is like this: "project/application/controllers/admin/admin_login/administrator.php"
[eluser]riwakawd[/eluser]
[quote author="Massaki" date="1397653123"]First, you must be sure that your controller path is like this: "project/application/controllers/admin/admin_login/administrator.php" [/quote] Yes it is. Even On The Routes To. Just does not seem to work in sub subdirectory
[eluser]Massaki[/eluser]
Can you call it normally? (http://yoursite.com/project/admin/admin_...inistrator)
[eluser]Tpojka[/eluser]
I think your application/config/router.php is loaded before application/core/MY_Router.php so it can't see subfolders. If I am right you have 2 level subfolders in controllers folder and CI by default can read only one.
[eluser]riwakawd[/eluser]
[quote author="Tpojka" date="1397690883"]I think your application/config/router.php is loaded before application/core/MY_Router.php so it can't see subfolders. If I am right you have 2 level subfolders in controllers folder and CI by default can read only one.[/quote] I have found what I am after to solve my own issue http://stackoverflow.com/questions/21551...ollers-and Get the right sub directories working. Latest version ci
[eluser]riwakawd[/eluser]
Thought it worked I went to refresh page second time did not work very strange.
[eluser]riwakawd[/eluser]
[quote author="Tpojka" date="1397724936"]Clear the cache to make sure if (not) working.[/quote] Still nothing so frustrated wont work even though names of controllers are correct. You would think codeigniter will be able to pick up controller / folder / folder / controller.php seems strange can not do that for default controller route. I have CodeIgniter_2.1.4 Code: <?php
[eluser]Tpojka[/eluser]
Check this great explained article. You can see that router.php is called before application/core classes. Therefore default CodeIgniter installation still don't use MY_Router.php during initializing default route. I said that in post before. |
Welcome Guest, Not a member yet? Register Sign In |