Statistics
286
5
1
6d
Badges
Requirements

Admin

Admin

Alt text

Login

Alt text

Live Demo

Live Demo

Github Demo

Installation

composer.json

{
    "require":{
        "kollarovic/admin": "dev-master"
    }
}

config.neon

extensions:
  navigation: Kollarovic\Navigation\DI\Extension
  admin: Kollarovic\Admin\DI\Extension
  

Admin

BasePresenter


namespace App\BackendModule\Presenters;

use Nette\Application\UI\Presenter;
use Kollarovic\Admin\IAdminControlFactory;


abstract class BasePresenter extends Presenter
{

    /** @var IAdminControlFactory @inject */
    public $adminControlFactory;

    protected function createComponentAdminControl()
    {
        $adminControl = $this->adminControlFactory->create();
        return $adminControl;
    }

}

@layout.latte

{capture $content}
  {include content}
{/capture}

{control adminControl content=>$content}

Login

SignPresenter


namespace App\BackendModule\Presenters;

use Kollarovic\Admin\ILoginControlFactory;
use Nette\Application\UI\Presenter;


class SignPresenter extends Presenter
{

    /** @var  ILoginControlFactory @inject */
    public $loginControlFactory;


    protected function createComponentLoginControl()
    {
        $loginControl = $this->loginControlFactory->create();
        $loginControl->onLoggedIn[] = function() {
            $this->redirect('Homepage:default');
        };
        return $loginControl;
    }

}

in.latte

{control loginControl}

No release at this moment. Try to create first one.

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette admin@componette.com