CodeIgniter Forums
Functions... - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Functions... (/thread-10818.html)

Functions... - El Forum - 08-13-2008

How would I go about adding functions to a controller that receives in input?

For example, my index function show the basic "project" page:

"federal-building" is my project_name that gets sent.

function index($project_name)

But when somebody clicks on an image, I want to launch:

function photo($photoid, $project_name)

this url would be http://localhost:8888/website/project/federal-building/photo/1/

The $photoid would be 1 in this url.

For some reason the function doesn't get hit when I use this url, how would I do something like this?

Functions... - El Forum - 08-13-2008

You misunderstood the url scheme.

Your url should be something like:


You might also need to rethink your function, I can't think of a situation in which you would need to path both the id and the name in an url.