D
D
DarkByte20152017-10-20 12:30:03
Yii
DarkByte2015, 2017-10-20 12:30:03

How to make a route?

How to make such url article/author/edit in urlmanager if I have ArticleController::actionEditAuthor? Three words through a slash confuse me. In the same place, the route usually goes like controller / action, but I don’t understand how to specify it here ...
PS Yii2.
And one more question at the same time small. The model already has an id field filled in (by which I will search for the model to edit). Does it make sense for me to specify it in the url? Or you can do something like this

$classname = StringHelper::basename(ArticleAuthor::className());
$id = Yii::$app->request->post()[$classname]['id'];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-10-20
@DarkByte2015

'article/author/edit' => 'article/edit-author'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question