I set the title field to be required.
$validator
->requirePresence('title', 'create')
->notEmpty('title');
the problem is that the title input is not marked as required. I don't have this problem with another table.
I set the title field to be required.
$validator
->requirePresence('title', 'create')
->notEmpty('title');
the problem is that the title input is not marked as required. I don't have this problem with another table.
I found the answer after an hour. it was a little mistake.
in controller action I wrote:
$this->set('gallery');
while I should do this:
$this->set('gallery',$gallery);
sorry for wasting your time.