Commit bd74917ca0ca60b005f66e66bb5b2350ac12b66c
1 parent
e147d391
VItaliy 21.12.2015
upload
Showing
2 changed files
with
8 additions
and
2 deletions
Show diff stats
frontend/config/main.php
| ... | ... | @@ -60,7 +60,7 @@ return [ |
| 60 | 60 | 'events/view/<translit:[\w-]+>'=>'events/view', |
| 61 | 61 | 'standard-services/view/<translit:[\w-]+>'=>'standard-services/view', |
| 62 | 62 | 'f/<filter:([\w\=\;\/\-\_]+)?>'=>'stone/ajax-filter', |
| 63 | - 'goods/<name:.+>'=>'goods/index', // переделать | |
| 63 | + 'goods/<name:[\w]+>/<id:[\w]+>'=>'goods/index', // переделать | |
| 64 | 64 | 'search'=>'site/search', |
| 65 | 65 | 'contact'=>'site/contact', |
| 66 | 66 | 'about'=>'site/about', | ... | ... |
frontend/controllers/GoodsController.php
| ... | ... | @@ -17,8 +17,14 @@ use yii\web\Controller; |
| 17 | 17 | class GoodsController extends Controller { |
| 18 | 18 | public $layout = '/internal'; |
| 19 | 19 | |
| 20 | - public function actionIndex($name = '') | |
| 20 | + public function actionIndex($name, $id) | |
| 21 | 21 | { |
| 22 | + | |
| 23 | + print('name = '.$name."<br>"); | |
| 24 | + print('id = '. $id); | |
| 25 | + die(); | |
| 26 | + | |
| 27 | + | |
| 22 | 28 | $arr = ['GoodsViewSearch' => ['name' => '0092S40090', |
| 23 | 29 | 'brand' => 'BOSCH']]; |
| 24 | 30 | ... | ... |