0

I am trying to get a route working, all I get so far is errors. So far I have:

    $route['gig/(:any)/(:any)'] = "gig/details/$1/$2/$3";

$1 is a gigcode variable, $2 is the seller and $3 is the title. I want the url to say gig/seller/title? How would I go about achieving this?

2
  • I am getting some weird view rendering errors, similar to when I had some routing problems before, so I am guessing there is a problem with the route. Do you know of a way to do the same route I am asking for using regex? Commented May 9, 2014 at 11:43
  • (:any) is simply replaced with (.*) in codeigniter... have you tried putting a die('test') at the top of the controller gig/details ? if its getting to the controller its not a route problem. Also please try to be more specific with your feedback, rather than saying "some wierd view rendering errors" why not actually copy + paste the error you are getting. it will help us to help you. Commented May 9, 2014 at 13:10

1 Answer 1

1

You will require a controller called gig, and a method called details in the following format:

public function details($gig_id, $seller, $title) {

}

Also your route is lacking one token, it should be:

$route['gig/(:any)/(:any)/(:any)'] = "gig/details/$1/$2/$3";

to correspond with your URL requirement.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.