davidyell / uploadedimage
Helper to output the current image and upload field for the Upload plugin
Installs: 265
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 0
Type:cakephp-plugin
Requires
- composer/installers: ~1.0
This package is auto-updated.
Last update: 2019-02-20 19:40:18 UTC
README
#UploadedImageHelper This is a quick helper to output a form field for the Jose Gonzalez Upload plugin along with the current image displayed as a thumbnail, with a link to view it's original.
##Requirements
Cake 2.x
Upload plugin - https://github.com/josegonzalez/upload
##Installation
You will need to install the plugin into app/Plugin/UploadedImage
and then activate it in your app/Config/bootstrap.php
with CakePlugin::load('UploadedImage');
unless you are already using loadAll()
.
Then add the helper file into your helpers array in your controller.public $helpers = array('UploadedImage.UploadedImage');
The helper take some settings, which you can find in the source $settings
property. These can be overwritten by passing new settings into the helper when you add it to the controller.
public $helpers = array( 'UploadedImage' => array( 'field' => 'logo', // Name of the db field - should match the 'field' in your Model's Upload settings 'dir' => 'logo_dir', // Name of the directory - should match 'dir' in your Model's Upload settings ) );
##Usage
echo $this->UploadedImage->display();
Todo
- Read the model configuration to save on configuring it
- Allow multiple upload fields