<?php $gallery = $model->getImages()
foreach($gallery as $img_g){
if($img_g->isMain == 0){ // тут используйте свои значения
Html::img($img_g->getUrl('200x200')
}
} ?>
public static function get($id)
{
$item = ShopPromoItem::findOne($id);
$class = 'app\\models\\' . $item->class;
return $class::findOne($id);
}
ShopPromoItem::findOne($id);
$class = '@app/models/' . $item->class;
$items[$ship->name] = [$ship->name]
public static function getNamges()
{
return ArrayHelper::map( self::find()->select(['name', 'id'])->all(), 'id', 'name');
}
$form->field($post, 'Who_ship')->dropDownList(Ship_company::getNames(), ['promt' => 'Select']);
<Directory /home/****/localhost/www/test.loc/>
Options -Indexes
# остальные настройки
</Directory>
// +38(073)222 33 44
['car_phone', 'match','pattern' => "#^+\d{1,3}\(\d{1,3}\)\d{3} \d{2} \d{2}$#"]
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://online.moysklad.ru/api/remap/1.1/entity/paymentin");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n \"organization\": {\n \"meta\": {\n \"href\": \"https://online.moysklad.ru/api/remap/1.1/entity/organization/ff24265a-ecfd-11e8-9109-f8fc000d545b\",\n \"type\": \"organization\"\n }\n },\n \"agent\": {\n \"meta\": {\n \"href\": \"https://online.moysklad.ru/api/remap/1.1/entity/counterparty/ff255c42-ecfd-11e8-9109-f8fc000d545e\",\n \"type\": \"counterparty\"\n }\n }\n}");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "admin@test515" . ":" . "123456");
$headers = array();
$headers[] = "Content-Type: application/json";
$headers[] = "Cache-Control: no-cache";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
а мне необходимо через контроллер
$imageDamage = UploadedFile::getInstance($postDamage, 'photo');
$imageDamage = UploadedFile::getInstances($postDamage, 'photo');
->field($model, 'photo[]')
uploadMultiple: true
['id_no', 'default', 'value' => null]
['date_to', 'date', 'when' => function($model){
return strtotime($model->date_to) < strtotime($model->date_from);
}, 'message' => 'Дата прилёта должна быть больше или равна Дате вылета']