Welcome Guest, Not a member yet? Register   Sign In
uri segments question
#1

[eluser]hcker2000[/eluser]
I know the usual model is /controller/method/param1/param2/ etc... What I am wanting to do is find all parameters after param1 as after param1 there could be any number of parameters.

This is for a gallery that I am working on so here are a few examples.

This would be an example of just going to the gallery no sub directories.
/gallery/1/

This would be with sub directories.
/gallery/1/art
/gallery/1/art/photos

the 1 is a record id in a database. That record contains the path to that galleries directory.

So far the only think I can think of is to do this.
Code:
$tmp = func_get_args();

and that does not seem to contain the segments I am looking for.
#2

[eluser]überfuzz[/eluser]
Have you tried using the uri class?

URI - help you to find segments.
#3

[eluser]hcker2000[/eluser]
Thanks I think thats going to have all the info that I need to get this figured out.
#4

[eluser]überfuzz[/eluser]
OK good! Now lets go slightly off topic. Lookning the url structure and the 'controllers' folder. You have the possibility to add a folder and point it out in the url.

Files and folders in the controllers folder:
Code:
controllers/admin/
gallery.php
users.php
etc.php

Now you'll reach lets say the add_picture function in the gallery controller using thie url: www.site.com/admin/gallery/add_picture
#5

[eluser]Jeremy Gimbel - Conflux Group[/eluser]
I think what you're asking about is putting controllers in subdirectories? But I'm not completely sure.

If so, yes you can certainly do that. You may need to add some additional routes to your config/routes.php file to make it work more smoothly.

Check out the Controller User Guide page for more info. It's got a section about putting controllers in subfolders.

jeremy
#6

[eluser]Genki1[/eluser]
I just wrote two functions for retrieving URI segments: http://ellislab.com/forums/viewthread/211352/




Theme © iAndrew 2016 - Forum software by © MyBB