Welcome Guest, Not a member yet? Register   Sign In
Can CodeIgniter auto-generate named routes?
#1

Is it possible to automatically generate named routes in CodeIgniter when using the $routes->resource() method?

For example, can the following named routes be generated:

posts for the index page
new_post for the new post form
show_post for displaying an individual post
Is there a way to generate all the necessary named routes automatically?
Reply
#2

Hey, my reply is a bit late but your post is why I found this forum in the first place. We are developing a large application and I was researching this, the option to automatically generate routes doesn't exist but I was considering basically writing a helper function and/or extending the router class to automate this. In the end I figured since there won't be THAT many routes anyway and its not like we are constantly adding new ones, that making something like this a reality would be counterproductive. In my case, I ended up manually setting up and naming the routes in an easily memorizable way for me. Of course maybe your application is different, and if you did end up making all the needed modifications I would be really keen on seeing how you implemented it in the end!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB