Welcome Guest, Not a member yet? Register   Sign In
Routes 4.0.0-beta.2
#1

Hy all .
I have some user defined routes stored in database to do some redirects .
example user/register (database stored) redirect  to register (app defined route )
My thoughts  of the day were to inject into Config\Routes or Events::on('pre_system'
PHP Code:
$routes->setAutoRoute(false);
$routes->add('login''Login::index');
$routes->add('register''Register::index');

 $routes->addRedirect('user/fff''/register'); //ErrorException Undefined offset: 1 SYSTEMPATH/Router\Router.php at line 472
$routes->addRedirect('user/fff''register' );  //ErrorException strpos() expects parameter 1 to be string, array given
$routes->addRedirect('user/fff''Register::index'); // not working SYSTEMPATH/Router\Router.php : 483 
  
throw RedirectException::forUnableToRedirect($val, $this->collection->getRedirectCode($key)); 

but seems that Config\Routes is called twice  and throw error when adding the redirect
How to inject new routes redirection and where ? Before declaring   route ? after ?

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
Routes 4.0.0-beta.2 - by tony.a - 04-30-2019, 03:52 PM
RE: Routes 4.0.0-beta.2 - by MGatner - 05-01-2019, 04:24 AM
RE: Routes 4.0.0-beta.2 - by kilishan - 05-01-2019, 06:47 AM
RE: Routes 4.0.0-beta.2 - by atsanna - 05-01-2019, 11:15 AM
RE: Routes 4.0.0-beta.2 - by tony.a - 05-04-2019, 11:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB