Answer the question
In order to leave comments, you need to log in
How to make cnc for a product card?
Good day.
I want to make a logical CNC product card, for example mtrade.loc/metalloprokat/armatura/list-stalnoy-06.html
rules in main.php:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'suffix' => '.html',
'rules' => [
'/' => 'site/index',
'error' => 'site/error',
'about' => 'site/about',
'contact' => 'site/contact',
'catalog' => 'category/catalog',
'news' => 'news/news',
'catalog/<alias:[\w_\/-]+>' => 'category/category', //категория
'<category:[\w_\/-]+>/<alias:[\w_\/-]+>' => 'products/products', //товары категории
'<parent:[\w_\/-]+>/<category:[\w_\/-]+>/<alias:[\w_\/-]+>' => 'products/product', // ссылка на карточку товара
],
],
echo \yii\helpers\Url::to(['products/product', 'parent'=>$get_parent->alias, 'category'=>$get_category->alias, 'alias' => $item['alias']]);
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