V
V
Vladimir2018-09-12 08:48:38
Yii
Vladimir, 2018-09-12 08:48:38

How to make Yii2 dynamic path?

Good day!
I have an Angular application and I need a trace. structure: "site.loc/user1/list". That's it "user1" and I want it to be dynamic. In Yii2, I wrote such rules '<user>/list' => 'site/index'. But it doesn't work, 404 error. I myself write "user1" in the main Angular template in the base href. Tell me, please, how to make "user1" on the Yii2 side accepted, so to speak, make it dynamic?
Thanks in advance for your replies!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kim, 2018-09-12
@MasterGerold

Try like this:

class SiteController extends Controller {
  public function actionList($login){}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question