Forms created with the Symfony Form component include CSRF tokens by default and Symfony checks them automatically, so you don't have to anything to be protected against CSRF attacks.
$query = ArticleRelation::find()->where(/*ваши фильтры*/);
$query->multiple = true;
return $query;
$scores = Matches::find()
->asArray()
->where(['tour_id' => $matche->tour_id, 'part' => $part])
->andWhere(['user1' => $matche->user1, 'user2' => $matche->user2])
->orWhere(['user1' => $matche->user2, 'user2' => $matche->user1])
->select([new Expression('sum(score1) sum_score1'),new Expression('sum(score2) sum_score2')])
->one();
/** @var ActiveQuery $query */
$query = clone $dataProvider->query;
$query->select('category_id')->asArray();
Category::find()->where(['id'=>$query])->select(['name','id'])->indexBy('id')->column();
$query->joinWith(['placeFrom placeFrom' , 'placeTo placeTo']);// добавили алиасы
$query
->andFilterWhere(['like', 'LOWER(placeFrom.name)', strtolower($this->placeFromName)])
->andFilterWhere(['like', 'LOWER(placeTo.name)', strtolower($this->placeToName)])
;
$this->head();
и на будущее, перечитывайте свой вопрос после отправки, если уж кнопка "Предпросмотр" вам не по душе public function getUsers($name = null)
{
$em = $this->getEntityManager();
$parameters = [':id' => 2];
$dql = 'SELECT u from User u where u.id > :id';
if($name){
$dql .= ' and u.name = :name';
$parameters[':name']=$name;
}
return $em
->createQuery($dql)
->setParameters($parameters)
->getResult();
}