Welcome Guest, Not a member yet? Register   Sign In
Loading/accessing a model from within routes config

[eluser]Daniel H[/eluser]
I want to dynamically create routes for a series of sections in a db table, which will simply route through to a page controller identified by their respective numeric id.

However I can't imagine there's an easy way to load and use a model in the routes config file, or at least I haven't been able to, such that I can dynamically generate these routes.

Has anyone tried something similar?


I'm trying to do the same thing, is there an alternative way to accomplish this goal? If not, is it possible to use the database class or a model in the routes.php, or is there a way to dynamically modify this config variable?

I include a file inmy routes.php, the contents of that file is generated from the db but is only written to on occasion so it's not 100% dnyamic. If i remember correctly there is no easy way to do this as the routing is called before any database is loaded

Theme © iAndrew 2016 - Forum software by © MyBB