Welcome Guest, Not a member yet? Register   Sign In
route cannot be found while reverse-routing.
#4

(This post was last modified: 05-20-2021, 12:24 AM by iRedds.)

PHP Code:
//1. Named route
$routes->get('cat/edit/(:num)''CatController::edit/$1', ['as' => 'cat.edit']);

redirect()->route('cat.edit', [$id])

//2. Controller&method (with namespace)
redirect()->route('\App\Controllers\CatController::edit', [$id])

//3. Url
redirect()->to('admin/cat/edit/' $id

Note that the withInput() method already adds validation error data.
To get errors you need:
PHP Code:
// init session (Even though it looks stupid in terms of practicality, but otherwise will not work.)
session();
// get validator instance
$validation Services::validation();
// get errors 
$validation->getErrors(); 
Reply


Messages In This Thread
RE: route cannot be found while reverse-routing. - by iRedds - 05-20-2021, 12:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB