Hi guys!
I try to to save the form, but I did not get. Like all of the documentation do, but it seems that somewhere pierced ...
public function settingsAction() {
$errors = false;
$settings = Settings::find();
$form = new SettingsForm($settings);
if($this->request->isPost()) {
$form->bind($_POST, $settings);
foreach ($settings as $item) {
if(!$item->save($_POST))
$errors = true;
}
//$settings->save();
if ($errors)
$this->flash->error('Error update.');
else
$this->flash->success('Success update.');
} else {
$this->view->settings = $form;
}
}
and settings.volt:
{% for setting in settings.getElements() %}
<div class="form-group">
{{ setting.getLabel({'class': 'col-md-2 control-label'}) }}
<div class="col-lg-10">
{{ setting.render({'class':'form-control'}) }}
</div>
</div>
{% endfor %}
database:
return error "Resultsets\Simple not found method save()"...
what am I doing wrong?