P
P
polynuc2017-08-21 12:46:30
Yii
polynuc, 2017-08-21 12:46:30

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?

Yii2 included in OpenCart index file
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

1 answer(s)
M
melnikov_m, 2017-08-21
@polynuc

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 question

Ask a Question

731 491 924 answers to any question