Unable To call function from URL |
[eluser]Blue Sapphire[/eluser]
Hi! I have following class code : Code: <?php I have set route in routes.php as follows: Code: $route['admin'] = "admin/main"; I am using following url: 1- http://localhost/personal/com/admin/ [This works fine and shows message] 2- http://localhost/personal/com/admin/myFunc [This url gives me '404 Page Not Found' error]. Can some one guide me where I am wrong and in solving this problem. Thanks in advance
[eluser]KPowell[/eluser]
When you set your routes, the first parameter is the controller, the second the method. So, in your example, you're trying to call the "main" method of the "admin" controller, which doesn't add up to what you have. If your application is admin, then setting the route to just "main" should do what you need.
[eluser]Blue Sapphire[/eluser]
Thanks for guidance. I have following scenario: 1- 'admin' is sub directory of 'controllers' directory. 'admin' directory will hold all admin related controllers. 2- 'main' is default controller in 'admin' sub directory. There will be many more controllers in 'admin' sub directory. 3- 'myFunc' is function in 'main' controller. Your guidance will be higly appreciated in this scenario. Thanks in advance
[eluser]yusufdestina[/eluser]
try http://localhost/personal/com/admin/main/myFunc |
Welcome Guest, Not a member yet? Register Sign In |