CodeIgniter Forums
Functions... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Functions... (/thread-10818.html)



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

[eluser]Unknown[/eluser]
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.

Code:
function index($project_name)


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

Code:
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

[eluser]plainas[/eluser]
You misunderstood the url scheme.

Your url should be something like:

http://localhost:8888/website/project/photo/1/somephotonamehere

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.