Routing issue |
PHP Code: $route['posts/create'] = 'PostApi/create'; These are my routes. I am having an issue where i got to www.blog.com/blog/index.php/posts/create and it takes me www.blog.com/blog/index.php/posts which is the page which displays all the posts. I want it to go to the create page. Below is the PostApi controller which loads the views.it seems to be going to index_get method instead of the create_post method. How do i fix this? PHP Code: class postApi extends RestController (12-26-2022, 01:19 PM)acewithacase Wrote: You should change route names Because 'posts/create' matches both 'posts/create' and 'posts/(:any)' May be Code: $route['post/create'] = 'PostApi/create';
The (:any) is a catch all route and should be the last routes defined!
PHP Code: $route['default_controller'] = 'pages/view'; What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |