Answer the question
In order to leave comments, you need to log in
How to globally change a route like ?r=controller/action&id=1 to ?route=%folder%/controller/action&id=1 in Yii2?
Hey!
I'm trying to make opencart friends with yii2, but the latter has little knowledge.
I need to make a change to the formation of the route throughout the system, i.e. instead of this ?r=controller/action&id=1 get this ?route=%folder%/controller/action&id=1 so that, for example, the GridView already displays the correct links.
It turns out you need to completely cut the route.
What is the best way to do this?
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
$yiiConfig = require(__DIR__ . '/yii/config/web.php');
new yii\web\Application($yiiConfig);
Answer the question
In order to leave comments, you need to log in
read about routing in general
https://nix-tips.ru/yii2-api-guides/guide-ru-runti...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question