Issue
Router::redirect() is deprecated. Use Router::scope() and RouteBuilder::redirect() instead.
The message gives some lead, but did not find direct answer in docs.
Direct switching to RouteBuilder::redirect()
instead not possible as it is not static function.
Solution
Ok I found the problem in the end. Easy once you read Router::scope()
usage in docs properly and notice you get RouteBuilder
object as param for the function.
Docs: https://book.cakephp.org/3/en/development/routing.html#quick-tour
Original (deprecated)
Router::redirect('/old', '/new');
New
Router::scope('/', function ($routes) {
$routes->redirect('/old', '/new');
});
Answered By - Nedvajz
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.