Welcome Guest, Not a member yet? Register   Sign In
need a help with uri
#1

[eluser]a.j.[/eluser]
hi, now I have http://localhost/project/index.php/main/...ingle/1008

and how to make that url to be - content/content-title-about-something or maybe content/2009/06/26/content-title-about-something

could you help me with configuring routes.php?

and how it should look in view file? instead of this:

<?=anchor('main/showContentSingle/'.$row->id, $row->title);?>


thanks in advance
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums.

I don't think routes is the answer. I think you should consider creating a controller that works the way you want it to.
#3

[eluser]VernonK[/eluser]
You could create a route that just accepted basic info: e.g.

$route['content/(:any)'] = 'main/showContentSingle/$1';

or something like

$route['content/(:num)/(:num)'] = 'mainShowContentSingle/$1/$2';

Of course your function would need to take the "title" or (whatever you applied to it) as variables for the function and be able to perform the operation you want.

You could also check out the $this->uri_segment() function in the manual. Might be of some help too.




Theme © iAndrew 2016 - Forum software by © MyBB