Nette plugin: Form extension for upload picture (JPG, PNG, SVG, ..) with thumbnail preview & lightbox original. Front-end solution for thumbnails.
Example in form:
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.
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);
}