Skip to content

Kollarovic/Admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published