$f = Html::activeDropDownList($searchModel, 'sid', ArrayHelper::map(Service::find()->where(['in', 'sid', $a])->orderBy(['service' => SORT_ASC])->asArray()->all(), 'sid', 'service'),['class'=>'form-control', 'prompt'=>'']);
$f1 = Html::activeDropDownList($searchModel, 'pstid', ArrayHelper::map(Post::find()->where(['in', 'pstid', $a1])->orderBy(['post' => SORT_ASC])->asArray()->all(), 'pstid', 'post'),['class'=>'form-control', 'prompt'=>'']);
ArrayHelper::map(Post::find()->where(['in', 'pstid', $a1])->orderBy(['post' => SORT_ASC])->asArray()->all()
'attribute' => 'posts',
'label' => 'Должность',
'value'=>'posts.post',
'filter' => $searchModel->getAllPost(),
//GridView
[
'attribute' => 'service_id',
'filter' => $searchModel->getServicesList(),
'value' => 'title'
],
[
'attribute' => 'post_id',
'filter' => $searchModel->getPostList(),
'value' => 'title'
],
//SearchModel
public function getServicesList()
{
$query = Services::find()->all();
return ArrayHelper::map($query, 'id', 'title');
}
public function getPostList()
{
if(!$this->services_id)
return false;
$query = Post::find()->where(['services_id' => $services_id])
return ArrayHelper::map($query, 'id', 'title');
}
// ContactForm
public $publish_at;
public function rules()
{
return [
['publish_at', 'date', 'timestampAttribute' => 'published_at', 'format' => 'dd.MM.y'],
]
}
public function contact($email)
{
echo $this->publish_at; // 15.09.2020
if ($this->validate()) {
echo $this->publish_at; // 1600128000
exit();
return true;
}
return false;
}
public function beforeSave($insert)
{
DateTime::createFromFormat('yyyy/mm/dd hh:ii', $this->publish_at)->getTimestamp();
return parent::beforeSave($insert);
}
$news->publish_at = $this->getTimestamp($publish_at);
v_i_kaisarov, нет, не правильно понимаете.
Модель ActivRecord для работы с базой, а Вам нужно только загрузить изображения.
По поводу ошибки.
https://www.google.com/search?q=%22Invalid+Configu...