Answer the question
In order to leave comments, you need to log in
Why is the URL not generated in yii2?
Rule in urlManager:
'<language:(ru|en)>/profile/<action:[\w-]+>/<entity_id:\d+>/<entity_name:.+>' => 'profile/default/<action>',
Url::to(['/profile',
'language' => 'ru',
'action' => 'club',
'entity_id' => 45,
'entity_name' => 'Juv']);
en/profile/club/45/Juventus
/profile?language=en&action=user&entity_id=45&entity_name=Juv
Url::to(['/profile/default/' . $action,
'language' => LanguageService::getCurrentKey(),
'entity_id' => $model->id,
'entity_name' => $model->getNameForSharing()], $scheme);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question