Why don't you take a parameter?
public function actionView($slug) in view so
<?=\yii\helpers\Html::a('LINK',[\yii\helpers\Url::to(['portfolio/view', 'slug' => $portfolio->slug])]); ?> I will debug in the Slug method that should arrive, NULL
it is clear that I can accept through the request het and this solves the problem. But I want to break up why it does not arrive
config
'showScriptName' => false, 'enablePrettyUrl' => true, //отключаем index.php 'rules' => [ 'about' => 'site/about', 'portfolio/<slug:\w+>' => 'portfolio/view',