PHPackages                             pagewiser/idn-nette - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pagewiser/idn-nette

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pagewiser/idn-nette
===================

Nette helpers and macros for IDN server

v0.2(10y ago)036BSD-3-ClausePHPPHP &gt;=5.3.0

Since Sep 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/pagewiser/idn-nette)[ Packagist](https://packagist.org/packages/pagewiser/idn-nette)[ RSS](/packages/pagewiser-idn-nette/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Nette IDN extension
===================

[](#nette-idn-extension)

IDN extension for Nette. Support uploading and image manipulation, adds macro for image handling into latte.

Install
-------

[](#install)

To register this extension into the Nette, add the latte macro extension to your config file.

**Nette 2.3.x**

```
extensions:
    idn: Pagewiser\Idn\Nette\Bridges\Nette\Nette23Extension

nette:
    latte:
        macros:
            - Pagewiser\Idn\Nette\IdnMacros::install

idn:
    apiHost: 'http://idnapi.pwlab.tk/'
    apiKey: 'your-api-key'
    apiSecret: 'your-api-secret'
    imageHost: '//storage.pwlab.tk/'
    lazy: TRUE
    client: 'client-name'
    profiler: TRUE
    dirAliases:
        profilePhoto: 'user/photo'

```

**Nette 2.2.x**

```
services:
	nette.latteFactory:
		setup:
			- Pagewiser\Idn\Nette\IdnMacros::install(::$service->getCompiler())

```

Then you need to configure your IDN account and API class.

```
idn:
	class: Marten\NetteIdn\Api('username', 'password')

```

Basic usage
-----------

[](#basic-usage)

### Image uploading

[](#image-uploading)

Presenter

```
/**
 * @var \Pagewiser\Idn\Nette\Api $idnApi
 * @inject
 */
public $idnApi

public function formSuccess(Form $form)
{
    $values = $form->getValues();
    try
    {
        $uploadedFile = $this->idnApi->upload('photos/'.$values['id'].'.jpg', $values['file']->getTemporaryFile());

        if ($uploadedFile['status'] !== 'success')
        {
            // Rollback
        }

        // Commit
    }
    catch (\Api\Exception\ApiException $e)
    {
        $form->addError($e->getMessage());
    }
}

```

If you reupload image with the same name, IDN server will clear the cache for this image automatically. It's still good practice to use generated filename, because it will handle local cache in browsers.

### Image display

[](#image-display)

Latte

```

```

Latte macro has 4 parameters.

- Directory where the image is stored
- Name of the file
- Required size
- Tranfromation options: \*\* f - Fill size with the image. Image can be bigger than provided size. \*\* e - Exact size of the image. Image will be stretched. \*\* c - Exact size of the image. Image will be cropped. \*\* b - Exact size of the image. Image will be resized to fit in the size, background will be added. \*\* a - Face detection. Image will be resized to required size, will be zoomed to face on the image.

### Deleting image

[](#deleting-image)

```
    try
    {
        try
        {
            $this->idnApi->delete('photos/', $photoName);
        }
        catch (\Pagewiser\Idn\Client\FileNotFoundException $ex)
        {
            // File not found, was already deleted?
        }
    }
    catch (\Pagewiser\Idn\Client\OperationException $ex)
    {
        $this->flashMessage($ex->getMessage(), 'warning');
    }

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3893d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/557fe3fb5c3fb03ff35111f8b8ca28f55293c4779a7c60c0f5135dd331370a02?d=identicon)[marten](/maintainers/marten)

---

Top Contributors

[![marten-cz](https://avatars.githubusercontent.com/u/582397?v=4)](https://github.com/marten-cz "marten-cz (22 commits)")

---

Tags

imagescdn

### Embed Badge

![Health badge](/badges/pagewiser-idn-nette/health.svg)

```
[![Health](https://phpackages.com/badges/pagewiser-idn-nette/health.svg)](https://phpackages.com/packages/pagewiser-idn-nette)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[desandro/imagesloaded

JavaScript is all like \_You images done yet or what?\_

8.9k439.0k1](/packages/desandro-imagesloaded)[mmo/faker-images

Different images provider for Faker

59370.3k6](/packages/mmo-faker-images)[smknstd/fakerphp-picsum-images

Alternative image provider for fakerphp using picsum.photos

45218.1k3](/packages/smknstd-fakerphp-picsum-images)[halimtuhu/array-images

A Laravel Nova field for distribute your images as array of object.

1441.2k](/packages/halimtuhu-array-images)[bigfork/htmleditorsrcset

Simple srcset integration with SilverStripe’s HTMLEditorField

1025.4k4](/packages/bigfork-htmleditorsrcset)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
