Welcome Guest, Not a member yet? Register   Sign In
Redirect to controller specific function w/parameters
#1

[eluser]chitoso[/eluser]
Hi guys, this is my first time here. I've been learning CI for a quick project. It's been a couple of days now and I think it was a great choice so far.

Anyway, I have a specific doubt that couldn't solve in this few days.

In my routes.php:

Code:
$route['admin/pages/edit/(:num)'] = 'admin/admin/edit_page/$1';

On my Admin Controller I have the function:

Code:
function edit_page($page_id) {
...

}

And in some point in edit_page I I'm doing some redirects like: redirect('admin/pages/edit/' . $page_id)

But, I'd feel it much more natural to do this: redirect('admin/admin/edit_page/', $page_id). This way, URLs wouldn't have to be so coupled in the code.

Is the first usage the way we're supposed to do this or am I missing something?

Thanks!


Messages In This Thread
Redirect to controller specific function w/parameters - by El Forum - 05-30-2010, 01:58 PM
Redirect to controller specific function w/parameters - by El Forum - 05-31-2010, 01:15 AM
Redirect to controller specific function w/parameters - by El Forum - 05-31-2010, 08:50 AM
Redirect to controller specific function w/parameters - by El Forum - 05-31-2010, 09:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB