Skip to content

Commit

Permalink
Merge pull request #470 from jWatsonDev/patch-1
Browse files Browse the repository at this point in the history
Update examples.rst
  • Loading branch information
josegonzalez committed Oct 4, 2017
2 parents 97eb2ed + 66e4baf commit fdabcd5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,29 @@ Basic example
<?php echo $this->Form->input('username'); ?>
<?php echo $this->Form->input('photo', ['type' => 'file']); ?>
<?php echo $this->Form->end(); ?>
Note: If you used *bake* to generate MVC structure after creating
the users table, you will need to remove the default scalar validation
for the photos field.
.. code:: php
public function validationDefault(Validator $validator)
{
$validator
->integer('id')
->allowEmpty('id', 'create');
$validator
->scalar('username')
->allowEmpty('username');
$validator
// remove ->scalar('photo')
->allowEmpty('photo');
return $validator;
}
?>
Deleting files
--------------
Expand Down

0 comments on commit fdabcd5

Please sign in to comment.