Skip to content

Commit

Permalink
Merge pull request #377 from jorisvaesen/master
Browse files Browse the repository at this point in the history
Some minor doc updates
  • Loading branch information
josegonzalez committed Mar 21, 2016
2 parents 5e303f6 + 75ef648 commit ea42c77
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ passed in under each field in your behavior configuration.

- Return: (string) the new name for the file

- ``keepFilesOnDelete``: Keep *all* files when uploading/deleting a record.
- ``keepFilesOnDelete``: Keep *all* files when deleting a record.

- Default: (boolean) ``true``
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Using `Composer <http://getcomposer.org/>`__
`View on
Packagist <https://packagist.org/packages/josegonzalez/cakephp-upload>`__,
and copy the json snippet for the latest version into your project's
``composer.json``. Eg, v. 3.0.0 would look like this:
``composer.json``.

.. code:: json
{
"require": {
"josegonzalez/cakephp-upload": "3.0.0"
"josegonzalez/cakephp-upload": "~3.0"
}
}
Expand Down
5 changes: 3 additions & 2 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ What does this plugin do?
* It can also move files around programatically. Such as from the filesystem.
* The path to which the files are saved can be customised.
* The plugin can also upload multiple files at the same time to different fields.
* Each upload field can be configured independantly of each other, such as changing the upload path etc.
* Each upload field can be configured independently of each other, such as changing the upload path etc.
* Uploaded file information can be stored in a data store, such as a MySQL database.
* You can upload files to both disk as well as distributed datastores such as S3 or Dropbox.
* It can optionally delete the files on record deletion
* It offers multiple validation providers but doesn't validate automatically

This plugin does not do
~~~~~~~~~~~~~~~~~~~~~~~
* Create thumbnails. You can use a custom Transformer to create modified versions of file uploads.
* It will not convert files between file types. You cannot use it convert a JPG to a PNG
* It will not add watermarks to images for you.
* It will not validate anything about your save.
4 changes: 2 additions & 2 deletions docs/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ explicitly load the validation provider(s) and attach each rule if needed.
Installation
^^^^^^^^^^^^

This plugin allows you to only load the validation rules that cover you needs.
This plugin allows you to only load the validation rules that cover your needs.
At this point there are 3 validation providers:

- UploadValidation (validation rules useful for any upload)
Expand Down Expand Up @@ -53,7 +53,7 @@ It might come in handy to only use a validation rule when there actually is an u
'message' => 'yourErrorMessage',
'provider' => 'upload',
'on' => function($context) {
return isset($context['data']['file']) && $context['data']['file']['error'] == UPLOAD_ERR_OK;
return !empty($context['data']['file']) && $context['data']['file']['error'] == UPLOAD_ERR_OK;
}
]);
Expand Down

0 comments on commit ea42c77

Please sign in to comment.