Welcome Guest, Not a member yet? Register   Sign In
put URL into variables instead of calling control/model possible?
#1

[eluser]Unknown[/eluser]
I want to make a page that only serves 1 purpose - query mysql based on received variables and render them out in a single view. For example, with mod rewrite, I want my URL to look like this

site.com/first/second

no matter what first and second are, they will be put into $var1 and $var2 and use the same controller/view.

Is it possible to do this?
#2

[eluser]oneos[/eluser]
Check out this page:
http://ellislab.com/codeigniter/user-gui...uting.html

Code:
// routes.php
$route['(:any)/(:any)'] = "some_controller/some_method/$1/$2";

// some_controller.php
function some_method($var1 = '', $var2 = '')
{
    // do stuff
}

Or somesuch.

If your application is doing anything else, you'd need other routes to pull out other controllers.




Theme © iAndrew 2016 - Forum software by © MyBB