'urlManager' => [
'enablePrettyUrl' => true,
'enableStrictParsing' => true,
'showScriptName' => false,
'rules' => [
'GET api/device' => 'api/device/index',
'POST api/device' => 'api/device/create',
'<module:[\w-]+>/<controller:[\w-]+>/<action:[\w-]+>/<id:\d+>' => '<module>/<controller>/<action>',
'GET api/search-dev/<serilal:[\w-]+>' => 'api/search-dev',
'GET api/dev-models/type/<type_id:\d+>/brand/<brand_id:\d+>' => 'api/dev-models',
'<module:[\w-]+>/<controller:[\w-]+>' => '<module>/<controller>',
],
],
if ($host != 'site.ru' ) {
rewrite ^/(.*)$ http://site.ru/$1 permanent;
}
$models = Models::find()->all();
return Html::dropDownList('nameSelectModels', null,
ArrayHelper::map($models, 'id', 'name'), [
'id' => 'selectModels',
'options' => ArrayHelper::map($models, 'id', 'dnames'),
]);
class Models{
...
public function getDname(){
return [
'data-imagesrc'=>"images/32x32/" . $this->name . ".png",
'data-description'=>$this->name
];
}
...
}