$query = "SELECT * FROM `product` where price >'$nahzap'";$query = Product::find()->where(['price' =$nahzap]);$query = Product::find()->where(['>', 'price', $nahzap]);
$nahzap=600;
$query = Product::find()->where(['>', 'price', $nahzap]);public function actionIndex()
{
$model = new Product();
if ($model->load(Yii::$app->request->post())) {
if($model->nahzap){
$nahzap = [$model->nahzap];
$query = Product::find()->where(['>', 'price', $nahzap]);
}
}<?php $form = ActiveForm::begin(); ?>
echo $form->field($model, 'nahzap')->textInput(['maxlength' => true]) ;
ActiveForm::end(); $nahzap=600;
$query = Product::find()->where(['>', 'price', $nahzap]); .public function actionIndex()
{
$model = new Product();
if ($model->load(Yii::$app->request->post())) {
if($model->nahzap){
$nahzap = [$model->nahzap];
$query = Product::find()->where(['>', 'price', $nahzap]);
}
}
То нет.
файл где находится форма main.php:
<code lang="php">
<?php $form = ActiveForm::begin(); ?>
echo $form->field($model, 'nahzap')->textInput(['maxlength' => true]) ;
ActiveForm::end();
</code>
$query = Product::find()->where(['>', 'price', $nahzap]);