HTML Code:
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default">
<span class="glyphicon glyphicon-ok"></span>
<input type="checkbox" value="Wiring" name="type_of_service_requires" autocomplete="off">Wiring
</label>
<label class="btn btn-default electric-ppoints">
<span class="glyphicon glyphicon-ok"></span>
<input type="checkbox" value="Powerpoints" name="type_of_service_requires" autocomplete="off" checked> Powerpoints
</label>
ASAP
Next few days
Residential
Commercial
The above line is showing output from HTML code.
Controller code:
public function actionGetQuotes()
{
$model = new GetQuotesForm();
if ($model->load(Yii::$app->request-> post()))
{
$model= array_key_exists('type_of_service_requires', $_POST)? $_POST['type_of_service_requires']:"";
$model= array_key_exists('residential_commercial', $_POST)? $_POST['residential_commercial']:"";
$model= array_key_exists('work_start_when', $_POST)? $_POST['work_start_when']:"";
if ($model->save(false))
{
Yii::$app->getSession()->setFlash('success', 'New Info Was Saved.');
}
}
return $this->render('get-quotes',['model' => $model,]);
}
It's showing: PHP Fatal Error – yii\base\ErrorException
Call to a member function save() on a non-object
Can anyone please help about this issue?