Welcome Guest, Not a member yet? Register   Sign In
URI Routing Help - 23.07.19
#5

(07-23-2019, 05:44 AM)Porto Wrote:
(07-23-2019, 03:03 AM)Digital_Wolf Wrote: I'm not exactly sure what you want to do, but maybe it will help:

Example 1:
$route['{segment-1} / {segment-2} / {segment-3}']
will be converted to:
https://example.com/segment-1/segment-2/segment-3/

Example 2:
$route['auth/welcome/( : segment)'] = "authentication/index/$1";
The value "segment" can be passed to the method "index" of the class "authentication".
* Example: https://example.com/auth/welcome/Jack
  displays: Welcome, Jack !

Example 3:
$route['photos/( : segment)/( :any)'] = "photos/catalogs_$1/id_$2";
The value "#segment" can be passed to the "#catalogs_&1" method of the "#photo" class, after which this value becomes the " #catalogs_***" method, and the value from "#:any" is passed to the ready method "#catalogs_****".
* Example: https://example.com/photos/cats/1
  Displays photos whose ID=1, from catalogue under the name cats...

P.S. If somewhere is wrong please correct me, I may be confused with CI4.

Sorry Guys,

i wrote a mistake.

$route['mf'] = 'mf/index';

This line above does not work! here we have the method (mf) and the index page of the method where should appear the "Form Page".

When i try to access this page, http://localhost/poll/mf  i see 404 Page Not Found

You say that you want to go to the url with segments "poll/mf", and then write in routs the following
$route["mf"] = "mf/index";
this is not the right way...

So you can type in the address bar of your browser https:://example.com/poll/mf
you need to change the route to the following:
$route["poll/mf"] = "mf";
and then you will have a controller with the class "mf" and its method "index()"
I would change this world, but God doesn't give me the source.
Reply


Messages In This Thread
URI Routing Help - 23.07.19 - by Porto - 07-23-2019, 12:47 AM
RE: URI Routing Help - 23.07.19 - by Digital_Wolf - 07-23-2019, 03:03 AM
RE: URI Routing Help - 23.07.19 - by Porto - 07-23-2019, 05:44 AM
RE: URI Routing Help - 23.07.19 - by Digital_Wolf - 07-23-2019, 09:04 AM
RE: URI Routing Help - 23.07.19 - by Wouter60 - 07-23-2019, 06:16 AM
RE: URI Routing Help - 23.07.19 - by InsiteFX - 07-23-2019, 03:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB