chapcz / admin
Admin template for Nette
0.3.0
2018-07-21 21:59 UTC
Requires
- php: >=7.0
- chapcz/navigation: ~2.0.0
- janmarek/webloader: ~2.4.0
- nette/nette: ~2.4
- nextras/forms: ~2.0.4
Requires (Dev)
- mockery/mockery: ~0.9
- nette/tester: ~1.3
This package is auto-updated.
Last update: 2024-11-29 04:19:57 UTC
README
Admin
Login
Live 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}