Yii
- 5 ответов
- 0 вопросов
1
Вклад в тег
activeRadio($model, $attribute, $options = ['uncheck' => null]);
radio($name, $checked = false, $options = ['uncheck' => null]);
Include /etc/apache2/vhosts.conf
sudo service apache2 restart
<?php
$dbTransaction = $Yii::app()->db->getCurrentTransaction();
if (!$dbTransaction) {
$dbTransaction = Yii::app()->db->beginTransaction();
}
$productModel = new Product;
$productModel->attributes = $prodAttrs;
if (!$productModel->save()) {
$dbTransaction->rollback();
throw new CException("some");
}
foreach ($productModes as $productModeAttrs) {
$productModeModel = new productMode;
$productModeModel->attributes = $productModeAttrs;
$productModeModel->product_id = $productModel->id;
if (!$productModeModel->save()) {
$dbTransaction->rollback();
throw new CException("some");
}
}
// похожее с фото товаров
$dbTransaction->commit();
// redirect/render/return метода контроллера