PHPackages                             geniv/nette-front-editor - 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. [Framework](/categories/framework)
4. /
5. geniv/nette-front-editor

ActiveLibrary[Framework](/categories/framework)

geniv/nette-front-editor
========================

Front editor extension for Nette Framework

v1.0.9(7y ago)0581MITPHPPHP &gt;=7.0.0

Since May 8Pushed 7y ago2 watchersCompare

[ Source](https://github.com/geniv/nette-front-editor)[ Packagist](https://packagist.org/packages/geniv/nette-front-editor)[ RSS](/packages/geniv-nette-front-editor/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (12)Used By (0)

Front editor
============

[](#front-editor)

Installation
------------

[](#installation)

```
$ composer require geniv/nette-front-editor
```

or

```
"geniv/nette-front-editor": ">=1.0.0"
```

require:

```
"php": ">=7.0.0",
"nette/nette": ">=2.4.0",
"geniv/nette-general-form": ">=1.0.0",
"geniv/nette-identity": ">=1.0.0"
```

Include in application
----------------------

[](#include-in-application)

neon configure:

```
# front editor
frontEditor:
#   autowired: true
#   formContainer: FrontEditor\FormContainer
#   adminLink: "admin/%routerPrefix.adminBaseUrl%"
```

neon configure extension:

```
extensions:
    frontEditor: FrontEditor\Bridges\Nette\Extension
```

front editor v.1:
-----------------

[](#front-editor-v1)

presenters:

```
use FrontEditorControl;

//$this->template->frontEditorEnable = $this->isFrontEditorEnable();
//$frontEditor->setAcl($this->isFrontEditorEnable());
//$frontEditor->getFrontEditorEnableHash();

//odhlasi se z edit modu
//{control frontEditor.'-identText1'}

protected function createComponentFrontEditor(FrontEditor $frontEditor): FrontEditor
{
    $frontEditor->setTemplatePath(__DIR__ . '/templates/frontEditor.latte');
    $frontEditor->setAcl($this->user->isAllowed($this->getName(), 'edit'));
    $frontEditor->setData($this['config']->getEditor(static::IDENTIFIER));
    $frontEditor->onSuccess[] = function (Form $form, array $values) {
        try {
            if ($this['config']->setEditor(static::IDENTIFIER, $values['content'])) {
                $this->flashMessage($this->translator->translate('front-editor#onsuccess'), 'success');
            }
        } catch (\Dibi\Exception $e) {
            $this->flashMessage($e->getMessage(), 'danger');
        }
        $this->redirect('this');
    };
    return $frontEditor;
}
```

usage:

```
{control frontEditor}
```

front editor v.2:
-----------------

[](#front-editor-v2)

presenters front:

```
use FrontEditorControl;

protected function startup()
{
    parent::startup();

    $this->template->frontEditorEnable = $this->isFrontEditorEnable();
}

protected function createComponentFrontEditor(FrontEditor $frontEditor): Multiplier
{
    $frontEditor->setTemplatePath(__DIR__ . '/templates/frontEditor.latte');
    $frontEditor->setAcl($this->isFrontEditorEnable());

    return new Multiplier(function ($indexName) use ($frontEditor) {
        $data = $this['config']->getDataByIdent($indexName);
        if (!$data) {
            $this['config']->setEditor($indexName, $indexName); // create if not exists
            return $frontEditor;
        }
        // set type and add variable to frontEditor
        $frontEditor->getFormContainer()->setType($data['type']);
        $frontEditor->addVariableTemplate('type', $data['type']);

        $frontEditor->setData($data['content']);
        $frontEditor->onSuccess[] = function (Form $form, array $values) use ($data) {
            try {
                if ($this['config']->editData($data['id'], ['content' => $values['content']])) {
                    $this->flashMessage('done', 'success');
                }
            } catch (\Dibi\Exception $e) {
                $this->flashMessage($e->getMessage(), 'danger');
            }
            $this->redirect('this');
        };
        return clone $frontEditor;
    });
}
```

usage front:

```
logout edit mode

{control frontEditor.'-identText1'}
```

front editor v.3:
-----------------

[](#front-editor-v3)

presenters front:

```
use FrontEditorControl;

protected function startup()
{
    parent::startup();

    $this->template->frontEditorEnable = $this->isFrontEditorEnable();
}

protected function createComponentFrontEditor(IFrontEditor $frontEditor): IFrontEditor
{
    $frontEditor->setTemplatePath(__DIR__ . '/templates/frontEditor.latte');
    $frontEditor->setTemplatePathLink(__DIR__ . '/templates/frontEditorLink.latte');
    $frontEditor->setAcl($this->isFrontEditorEnable());

    $frontEditor->onLoadData = function ($identification) use ($frontEditor) {
        if ($identification) {
            $data = $this['config']->getDataByIdent($identification);
            $frontEditor->getFormContainer()->setType($data['type']);
            $frontEditor->addVariableTemplate('type', $data['type']);
            return $data;
        }
        return null;
    };

     $frontEditor->onLogout[] = function () {
        $this->handleFrontEditorDisable();
    };

    $frontEditor->onSuccess[] = function (Form $form, array $values) {
        try {
            if ($this['config']->editData((int) $values['id'], ['content' => $values['content']])) {
                $this['config']->cleanCache();
                $this->flashMessage($this->translator->translate('front-editor#onsuccess'), 'success');
            } else {
                $this->flashMessage($this->translator->translate('front-editor#onsuccess-fail'), 'danger');
            }
        } catch (\Dibi\Exception $e) {
            $this->flashMessage($e->getMessage(), 'danger');
        }
        $this->redirect('this');
    };
    return $frontEditor;
}
```

usage front:

```
{control frontEditor:link 'identText1'}
{control config:editor 'identText1'}

{control frontEditor}
```

front editor admin:
-------------------

[](#front-editor-admin)

presenters admin:

```
use FrontEditorControl;

$this->template->frontEditorEnableLink = $this->getFrontEditorEnableLink();
```

usage admin:

```
link
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 98% 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

Every ~29 days

Total

10

Last Release

2659d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc7e200eb4e96d99020297684063209160ea1347d8a2a8b4cd769d532204867e?d=identicon)[geniv](/maintainers/geniv)

---

Top Contributors

[![geniv](https://avatars.githubusercontent.com/u/563659?v=4)](https://github.com/geniv "geniv (49 commits)")[![MartinFugess](https://avatars.githubusercontent.com/u/4451137?v=4)](https://github.com/MartinFugess "MartinFugess (1 commits)")

---

Tags

netteeditorgenivfront

### Embed Badge

![Health badge](/badges/geniv-nette-front-editor/health.svg)

```
[![Health](https://phpackages.com/badges/geniv-nette-front-editor/health.svg)](https://phpackages.com/packages/geniv-nette-front-editor)
```

###  Alternatives

[vojtech-dobes/nette-ajax-history

Adds History API support for Nette Framework.

30179.4k2](/packages/vojtech-dobes-nette-ajax-history)[flame/modules

Nette modules on the Steroids

1361.6k3](/packages/flame-modules)

PHPackages © 2026

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