Hello,
Im writing my app using cakephp 4 and i am experiencing problems creating nested modelles form. I am able to validate nested field using nested validator but i have no idea how to force this nested field to be added to forms schema so it generates proper form controll in view.
I tried:
$schema->addField('order_services, 'array')
$serviceValidator = new Validator();
$serviceValidator->add('netPrice', 'decimal');
$serviceValidator->add('netPrice', 'length', ['rule' => ['maxLength', 3]]);
$validator->addNestedMany('order_services', $serviceValidator);
This way it validates ok but field is generic text field.
Then i tried:
->addField('order_services..netPrice', ['type' => 'decimal', 'maxlength' => 3])
Field is ok but validation is broken and there is no data from this field…
Is there any way to do this?