Welcome Guest, Not a member yet? Register   Sign In
Use __remap to Show 404 Page
#5

[eluser]fjamal[/eluser]
[quote author="Aken" date="1343784972"]Your _remap() method is basically emulating the exact method that CI itself uses to either call a valid controller method, or show a 404 page. I think you'd be better served by using routes rather than _remap().

The problem is that the method is found, and then all the remaining URI segments are passed as parameters to the method. You'd need to validate those parameters to establish whether or not they are valid, and then throw a 404 error if appropriate.[/quote]

I'm new to codeigniter, i don't know much about the framework structure and best practices of routings. For the time being i'm trying to build a basic structure that is fairly good enough to allow me complete tasks in a stable manner.

Here is my attempt:

Code:
http://localhost:8080/ci_centric/home/index/home

After dumping the parameter, home (the one after index) is stored in params. However, the params array is empty when i type this URL:

Code:
http://localhost:8080/ci_centric/home/home

The second home is supposed to be passed as parameter, but that's not the case. _remap deals with the second home as a controller. If i print $method, i get the value 'index'.

Note: i have htaccess that eliminates index.

Any idea to solve this issue?

All i need is preventing user from entering a duplicate controller's name beside the first controller as home/home (firstController/[strike]secondController[strike])


Messages In This Thread
Use __remap to Show 404 Page - by El Forum - 07-31-2012, 04:59 PM
Use __remap to Show 404 Page - by El Forum - 07-31-2012, 06:35 PM
Use __remap to Show 404 Page - by El Forum - 07-31-2012, 06:36 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 03:33 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 03:49 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 04:07 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 04:50 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 04:55 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 05:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB