Welcome Guest, Not a member yet? Register   Sign In
Problem in routing
#3

(This post was last modified: 12-23-2019, 03:12 PM by Digital_Wolf. Edit Reason: give examples. )

It must be:
PHP Code:
(required*) controller class specified :: (optionalcontroller method \ (for different queries) $

you can't use $n as a method placeholder or controller class itself.
in General it's something like requests made after the sign "?" in the address bar.

Example:
PHP Code:
https://example.com/controller/method/?other-query 

-> ?other-query it is substituted in a sign "$"
and that your site understood that to catch in requests and that to pass by, it is necessary to use "placeholders".


In Routes.php

PHP Code:
$routes->add('admin/(:any)', 'ContentAdminController::index/$1'); 

In ContentAdminController.php

PHP Code:
class ContentAdminController extends Controller
{
         public function 
index(string $any) {
             echo `
Any segment: {$any}`;
         }

I would change this world, but God doesn't give me the source.
Reply


Messages In This Thread
Problem in routing - by Dedov_Evgeniy - 12-16-2019, 05:59 PM
RE: Problem in routing - by Dedov_Evgeniy - 12-23-2019, 10:12 AM
RE: Problem in routing - by Digital_Wolf - 12-23-2019, 02:44 PM
RE: Problem in routing - by Dedov_Evgeniy - 12-23-2019, 04:56 PM
RE: Problem in routing - by Digital_Wolf - 12-24-2019, 03:55 AM
RE: Problem in routing - by InsiteFX - 12-24-2019, 04:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB