if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
}
$this->products=$this::find()->asArray()->all();
public static function types(){
return ArrayHelper::map(self::find()->asArray()->all(),'title','title');
}
$types = Product::types();
$this->render('view', [... , 'types' => $types]);
вот это
правильнее будет не закомментировать, а изменить
В остальном верно