studioartcz / imageslave
Form extension & Image thumbs solution for Nette framework
dev-master
2016-09-20 21:20 UTC
Requires
- php: >= 5.6.0
- nette/di: >= 2.2.0
- nette/forms: >= 2.2.0
- nette/php-generator: >= 2.2.0
- nette/utils: >= 2.2.0
This package is not auto-updated.
Last update: 2024-09-14 19:47:34 UTC
README
Nette plugin: Form extension for upload picture (JPG, PNG, SVG, ..) with thumbnail preview & lightbox original. Front-end solution for thumbnails.
Example in form:
How install actual version
Add via composer to your project:
$ composer require studioartcz/imageslave @dev
Add to extensions in your config.neon (for advanced setup see doc)
extensions:
imageslave: App\Form\Control\ImageSlaveExtension
For lightbox preview download client-side assets via bower:
$ cd {fill-your-path}/vendors/studioartcz/imageslave/
$ bower install
Add rules to Grunt - example and add your copied JS with files from client-side folder.
Using in Forms
Create form:
public function create()
{
$form = new Form();
$form->addImageSlave("picture", "Pretty picture");
$form->onSuccess[] = array($this, "processForm");
return $form;
}
Working with data:
public function processForm(Form $form, $values)
{
var_dump($values->picture);
}