• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
something weird with route config

#1
First:
Here how i check the router: System/Router/Router.php function: handle(string $uri = null)

PHP Code:
if ($this->checkRoutes($uri))
{
 
   var_dump($uri);
 
   var_dump($this->controller);
    return 
$this->controller;


This happens when I edit App/Config/Routes.php,
When I have:

PHP Code:
$routes->add('/(:segment)''\App\Controllers\Vendors\$1::index'); 
The result on controller path: (http://localhost/samsung)

PHP Code:
\App\Controllers\Vendors$
No backslash here. Also dollar sign shown.
But When im using:
PHP Code:
$routes->add('/(:segment)''\App\Controllers\Vendors\V$1::index'); 

The result is: (http://localhost/samsung)

PHP Code:
\App\Controllers\Vendors\Vsamsung 
Dollar sign changed with segment.

Not what I expect, but this trick is working for me. Although vendor controller need using prefix
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.