2017 © Pedro Peláez
 

cakephp-plugin cakephp-simple-upload

Upload handle plugin for CakePHP

image

dala00/cakephp-simple-upload

Upload handle plugin for CakePHP

  • Friday, January 27, 2017
  • by dala00
  • Repository
  • 1 Watchers
  • 1 Stars
  • 220 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

Simple upload handle plugin for CakePHP3

Software License Build Status Coverage Status, (*1)

Description

  • Handle file post to save and upload automatically.
  • UploadHelper can output URL and img tag on template.
  • Methods for confirm page are available.

Installation

You can install this plugin into your CakePHP application using composer., (*2)

The recommended way to install composer packages is:, (*3)

composer require dala00/cakephp-simple-upload

And load plugin on bootstrap.php., (*4)

Plugin::load('Dala00/Upload');

Usage

Load UploadBehavior with options., (*5)

class SomeTable extends Table {
    public function initialize(array $config) {
        $this->addBehavior('Dala00/Upload.Upload', [
            'fields' => [
                'photo' => [
                    'path' => 'webroot{DS}files{DS}{model}{DS}{primaryKey}{DS}{field}{DS}'
                ],
            ],
        ]);
    }
}

UploadHelper

You can output URL or img tag with UploadHelper., (*6)

// In Controller
public $helpers = ['Dala00/Upload.Upload'];
(In Templates)
<img src="<?= $this->Upload->url($entity, $fieldName) ?>">
or
<?= $this->Upload->image($entity, $fieldName) ?>
<?= $this->Upload->image($entity, $fieldName, $options) ?>



### Using confirm page If you want show confirm page before saving post, next method saves files as cache. ```php // Call in action when confirm page will be shown $this->SomeTable->uploadTmpFile($entity);
```php // Output hidden tag with UploadHelper on templates <?= $this->Upload->hidden($entity, $fieldName) ?>

Licence

MIT, (*7)

The Versions

27/01 2017

dev-master

9999999-dev

Upload handle plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shoichi Namba

orm cakephp upload behavior files

27/01 2017

1.0.5

1.0.5.0

Upload handle plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shoichi Namba

orm cakephp upload behavior files

11/01 2017

1.0.4

1.0.4.0

Upload handle plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shoichi Namba

orm cakephp upload behavior files

11/01 2017

1.0.3

1.0.3.0

Upload handle plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shoichi Namba

orm cakephp upload behavior files

11/01 2017

1.0.2

1.0.2.0

Upload handle plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shoichi Namba

orm cakephp upload behavior files

09/04 2016

1.0.1

1.0.1.0

Upload handle plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shoichi Namba

orm cakephp upload behavior files

08/04 2016

1.0.0

1.0.0.0

Upload handle plugin for CakePHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shoichi Namba

orm cakephp upload behavior files