2017 © Pedro Peláez
 

library image-storage

Image storage for Nette Framework

image

nattreid/image-storage

Image storage for Nette Framework

  • Tuesday, December 5, 2017
  • by attreid
  • Repository
  • 1 Watchers
  • 0 Stars
  • 147 Installations
  • PHP
  • 4 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 6 % Grown

The README.md

Uložistě obrázků pro Nette Framework

Nastavení v config.neon, (*1)

extensions:
    images: NAttreid\ImageStorage\DI\ImageStorageExtension

images:
    assetsPath: '%wwwDir%/../assets'
    noImage: 'default/default.png'
    publicDir: 'assets'
    quality: 85
    defaultFlag: 'fit'
    domain: '//domena/' # zobrazi url obrazku na jine domene
    timeout: 10

Použití v presenteru

Do hlavního presenteru vložit, (*2)

class BasePresenter {
    use \NAttreid\ImageStorage\TraitImagePresenter;
}

Ukládání obrázků, (*3)

/* @var $fileUpload \Nette\Http\FileUpload */
$resource = $storage->createUploadedResource($fileUpload);

// nebo z cesty
/* @var $location string */
$resource = $storage->createResource($location);

// pridame namespace
$resource->setNamespace('namespace');

// ulozime
$storage->save($resource);

// zobrazime url adresu
echo $storage->link($result);

// $id pro ulozeni
$id = $resource->getIdentifier();

Získání obrázku, (*4)

$resource = $storage->createResource($id);

Přesouvání obrázků, (*5)

$resource = $storage->createResource($id);
$resource->setNamespace('jine/namespace');
$storage->save($resource);

Odstranění obrázku, (*6)

$storage->delete($id);
//nebo vice najednou
$ids=[....];
$storage->delete($ids);

Šablony

Zobrazení obrázku, (*7)

{img 'image.jpg'}
<img n:img="'image.jpg', '100x100', 'fill', 80">

The Versions

05/12 2017

dev-master

9999999-dev

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

05/12 2017

1.0.11

1.0.11.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

04/10 2017

1.0.10

1.0.10.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

29/09 2017

1.0.9

1.0.9.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

14/09 2017

1.0.8

1.0.8.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

04/09 2017

1.0.7

1.0.7.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

01/09 2017

1.0.6

1.0.6.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

01/09 2017

1.0.5

1.0.5.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

17/08 2017

1.0.4

1.0.4.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

25/07 2017

1.0.3

1.0.3.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

20/07 2017

1.0.2

1.0.2.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

20/07 2017

1.0.1

1.0.1.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

20/07 2017

1.0.0

1.0.0.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid

20/07 2017

0.0.1

0.0.1.0

Image storage for Nette Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar attreid