Create routes - Codeigniter

Asked

Viewed 319 times

0

Well, I have this route set in my Routes file :

$route['novidades-e-estrategias-de-marketing-digital-em-nosso-blog/(.*)/(.*)'] = "blog/post_list/$1";

This is the url :

novidades-e-estrategias-de-marketing-digital-em-nosso-blog/19/sistema-de-crm-para-auxilio-ao-time-de-vendas

Being that it is formatted like this :

return site_url(lang('list_route').'/'.$category->id.$preffix);

But now I need to leave my url in this format :

sistema-de-crm-para-auxilio-ao-time-de-vendas-catid-19

That is to say :

base_url().$preffix.'-catid-'.$cateogory->id;.

My question is, with these modifications, how do I route?

  • 1

    I don’t understand how it will look, but the numeric parameter in the IC is (:num), just you modify.

1 answer

2


I decided as follows :

$route["(.*)-catid-(:num)"]      = "blog/post_list/$2";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.