Below you can see my model and view. Can't figure out how to display validation error message. How do I do that? All other validation messages for input fields are displayed as expected.
class ProjectsTable extends Table {
public function validationDefault(Validator $validator) {
$validator->requirePresence('language');
return $validator;
}
}
<?php echo $this->Form->select('language', [
'option' => 'value',
'' => 'Select'
], ['default' => '']); ?>
Another possibility is to use $this->Form->input()
instead of select()
.
<?php
$this->Form->input('language', [
'type' => 'select',
'options' => [
'option' => 'value'
]
]);
?>