Hack Forums
[PHP] Trying to configure routes in CodeIgniter - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] Trying to configure routes in CodeIgniter (/showthread.php?tid=4311218)



Trying to configure routes in CodeIgniter - theAbsolute - Jun 28, 2014

Let's say I have this one:

PHP Code

<?php 
$route
['profile/(:any)'] = 'profile/index/$1'; 

That will take any profile/some_profile to the proper page, what's good.

Now I've made a function for profile comments. Obviously, because the above route, the function is not accessable.

So I'm trying to do something like this:

PHP Code

<?php 
$route
['profile/(:any)/addcomment'] = 'profile/index/$1/addcomment'; 

But that would do just nothing. Tried changing place of these two routes, but not of help.

How can I have both of these routes working? One for profile page, one which would load the funtion?