Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
/ file Public archive

CakePHP plugin for upload files with processing images using GD or ImageMagick library

License

Notifications You must be signed in to change notification settings

slicesofcake/file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CakePHP plugin for upload files

Build Status Scrutinizer Code Quality LICENSE Releases

Upload files with processing images using GD or ImageMagick library.

Requirements

It is developed for CakePHP 4.x.

Installation

You can install plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require slicesofcake/file

Setup

Add file type input in your view:

echo $this->Form->control('logo', [
    'type' => 'file',
]);

You should also add 'type' => 'file' in your creating form method.

Note: If you want use multiple file input (from HTML5), just replace name of input field from logo to logo[] and add to options attribute multiple.

Next, load behavior in your table on initialize method, like below:

$this->addBehavior('SlicesCake/File.File', [
    'logo',
]);

Note: Field should be accessible in Entity class.

TODOs