YuriiChmil
YuriiChmil

Reputation: 481

Manage route in yii by users

I have one task and I really don't know how to do that. So there is the table with all actions in Yii web application. All authorization's users can create their own link that indicate to particularly action, for example: There is action name's actionGetAllMovies, and user Sarah set her link 'favouriteMovie', Jack set like 'coolMovie',etc... and when they type their link, they redirect to action actionGetAllMovies. How did "teach" YII realized properly reads this links?

Upvotes: 0

Views: 46

Answers (1)

Andrey
Andrey

Reputation: 441

in parent controller, in BeforeAction you can get:

1) Controller name: Yii::app()->controller->id

2) And action name: Yii::app()->controller->action->id

3) As you normally known user_id: Yii::app()->user->id

We can only make a request to the database is there for user, controller and action redirect.

Or maybe I misunderstood something?

Upvotes: 0

Related Questions