kollarovic / admin
Admin template for Nette
Installs: 1 016
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 4
Forks: 11
Open Issues: 1
Requires
- php: >= 8.0
- kollarovic/navigation: ^4.0
- latte/latte: ^3.0
- nette/application: ^3.1
- nette/bootstrap: ^3.2
- nette/forms: ^3.1
- nette/robot-loader: ^4.0
- nette/security: ^3.1
- nette/utils: ^4.0
- nextras/forms-rendering: ^2.0@dev
Requires (Dev)
- nette/tester: ^2.5
- phpstan/phpstan-nette: ^1.2
This package is auto-updated.
Last update: 2024-10-22 13:21:29 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}