File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,29 @@ Basic example
6666 <?php echo $this->Form->input('username'); ?>
6767 <?php echo $this->Form->input('photo', ['type' => 'file']); ?>
6868 <?php echo $this->Form->end(); ?>
69+
70+ Note: If you used *bake* to generate MVC structure after creating
71+ the users table, you will need to remove the default scalar validation
72+ for the photos field.
73+
74+ .. code :: php
75+ public function validationDefault(Validator $validator)
76+ {
77+ $validator
78+ ->integer('id')
79+ ->allowEmpty('id', 'create');
80+
81+ $validator
82+ ->scalar('username')
83+ ->allowEmpty('username');
84+
85+ $validator
86+ // remove ->scalar('photo')
87+ ->allowEmpty('photo');
88+
89+ return $validator;
90+ }
91+ ?>
6992
7093 Deleting files
7194--------------
You can’t perform that action at this time.
0 commit comments