Skip to content

Commit

Permalink
docs: cleanup headers
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Jan 2, 2017
1 parent b220a32 commit 21cef97
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 92 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Behavior configuration options
------------------------------
==============================

This is a list of all the available configuration options which can be
passed in under each field in your behavior configuration.
Expand Down
9 changes: 5 additions & 4 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Examples
--------

Basic example
~~~~~~~~~~~~~
-------------

Note: You may want to define the Upload behavior *before* the core
Translate Behavior as they have been known to conflict with each
Expand Down Expand Up @@ -101,23 +101,24 @@ field must be added to store the directory of the file as follows:
<?php echo $this->Form->end(); ?>
Displaying links to files in your view
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------

Once your files have been uploaded you can link to them using the ``HtmlHelper`` by specifying the path and using the file information from the database.

This example uses the `default behaviour configuration <configuration.html>`__ using the model ``Example``.

.. code:: php
<?php
// assuming an entity that has the following
// assuming an entity that has the following
// data that was set from your controller to your view
$entity = new Entity([
'photo' => 'imageFile.jpg',
'photo_dir' => '7'
]);
$this->set('entity', $entity);
// You could use the following to create a link to
// You could use the following to create a link to
// the image (with default settings in place of course)
echo $this->Html->link('../files/example/image/' . $entity->photo_dir . '/' . $entity->photo);
?>
Expand Down
16 changes: 10 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
************
Introduction
------------
************

Upload Plugin 3.0
~~~~~~~~~~~~~~~~~
=================

The Upload Plugin is an attempt to sanely upload files using techniques garnered from packages such as MeioUpload , UploadPack and PHP documentation. It uses the excellent `Flysystem <http://flysystem.thephpleague.com/>` library to handle file uploads, and can be easily integrated with any image library to handle thumbnail extraction to your exact specifications.

Background
~~~~~~~~~~
----------

Media Plugin is too complicated, and it was a PITA to merge the latest updates into MeioUpload, so here I am, building yet another upload plugin. I'll build another in a month and call it "YAUP".

Requirements
~~~~~~~~~~~~
------------

* CakePHP 3.x
* PHP 5.4+

What does this plugin do?
~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------

* The Upload plugin will transfer files from a form in your application to (by default) the ``webroot/files`` directory organised by the model name and upload field name.
* It can also move files around programatically. Such as from the filesystem.
* The path to which the files are saved can be customised.
Expand All @@ -29,7 +32,8 @@ What does this plugin do?
* 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.
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Installation
------------
============

The only officialy supported method of installing this plugin is via composer.

Using `Composer <http://getcomposer.org/>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------

`View on
Packagist <https://packagist.org/packages/josegonzalez/cakephp-upload>`__,
Expand All @@ -16,7 +16,7 @@ and copy the json snippet for the latest version into your project's
composer require josegonzalez/cakephp-upload
Enable plugin
~~~~~~~~~~~~~
-------------

You need to enable the plugin your ``config/bootstrap.php`` file:

Expand Down
8 changes: 4 additions & 4 deletions docs/interfaces.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Upload Plugin Interfaces
--------------------------
========================

For advanced usage of the upload plugin, you will need to implement
one or more of the followng interfaces.


ProcessorInterface
~~~~~~~~~~~~~~~~~~
------------------

Fully-namespaced class name: ``Josegonzalez\Upload\File\Path\ProcessorInterface``

Expand All @@ -18,7 +18,7 @@ This interface is used to create a class that knows how to build paths for a giv
Refer to ``Josegonzalez\Upload\File\Path\DefaultProcessor`` for more details.

TransformerInterface
~~~~~~~~~~~~~~~~~~~~
--------------------

Fully-namespaced class name: ``Josegonzalez\Upload\File\Transformer\TransformerInterface``

Expand All @@ -31,7 +31,7 @@ Other than the constructor, it contains one method:
Refer to ``Josegonzalez\Upload\File\Transformer\DefaultTransformer`` for more details. You may **also** wish to look at ``Josegonzalez\Upload\File\Transformer\SlugTransformer`` as an alternative.

WriterInterface
~~~~~~~~~~~~~~~
---------------

Fully-namespaced class name: ``Josegonzalez\Upload\File\Writer\WriterInterface``

Expand Down
Loading

0 comments on commit 21cef97

Please sign in to comment.