Welcome Guest, Not a member yet? Register   Sign In
id replace the url

Hello, how can I sotituire id in a url like

with a name of a file?

for example if 123 is the id of a file, I can make the URL

Similar to how must CMS systems work. Pass the parameter to your function, lookup "slug" (filename) in database for the file / file id, and handle accordingly. You could use a regular expression to make it work for either or.
function shoes(){
   $action = $this->uri->segment(3,'view');

     case 'show':
         $product_id = $this->uri->segment(4);
         $product_id = $this->product_model->getShoes($this->uri->segment(4))->row(0)->shoes_id;
     //other actions here

maybe I did not understand your answer but I try to explain better:

for example in this case http://www.voices.com/people/MichelleFalzon

"People" is the controller and "MichelleFalzon" is the resource or other parameter that is passed to the controller which then will return the resource ... I would do the same thing ....

how can I proceed side code?

Yes you would do the same as the example I provided above. You are just looking a name rather than a id for a record in the DB. You will just have to make sure that a name cannot be entered twice, otherwise the second record wouldn't be accessible.

Maybe I have to work with custom remap URL by URL routing?

My apologies, I hadn't notice that you were giving another example with a different number of segments. You would use a route like:
$routes['people/(:any)'] = 'people/function/$1';

And what would this rule?

Theme © iAndrew 2016 - Forum software by © MyBB