Componette

Componette

download-cloud-line composer require kollarovic/admin

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}
Componette Componette felix@nette.org