ultrascn / admin
Administration extension for Nette.
Fund package maintenance!
Other
Installs: 5 913
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: 7.4 - 8.2
- czproject/assert: ^1.3
- inteve/application: ^1.0
- inteve/assets-manager: ^0.5
- inteve/datagrid: ^0.4 || ^1.0
- inteve/forms: ^1.0 || ^2.0
- inteve/navigation: ^3.5
- latte/latte: ^2.4
- nette/application: ^2.4
- nette/http: ^2.4
- nette/security: ^2.4
- typro/bridge-nette-forms: ^1.0
- typro/typro: ^3.3
Requires (Dev)
- nette/bootstrap: ^2.4
- nette/di: ^2.4
- nette/tester: ^2.0
README
Administration extension for Nette.
Installation
Download a latest package or use Composer:
composer require ultrascn/admin
UltraSCN\Admin requires PHP 7.4.0 or later.
Usage
Copy assets from assets
directory to your website public directory
Edit config.neon
extensions: admin: UltraScn\Admin\DI\AdminExtension admin: title: Admin homepagePresenter: 'Admin:Dashboard:default' signPresenter: 'Admin:Sign:in' signOutLink: 'Admin:Sign:out' assets: publicBasePath: '/' defaultEnvironment: 'production' scripts: - path/to/netteForms.js - ['path/to/less.js', 'development', 'critical'] stylesheets: - ['path/to/ultrascn/admin/styles.css', 'production'] - ['path/to/ultrascn/admin/styles.less', 'development'] bundles: - nette/forms router: prefix: admin packages: dashboard: 'CmsDashboard:Dashboard:' orders: 'CmsOrders:Order:list' users: 'CmsUsers:User:' defaultPackage: dashboard appPresenter: 'MyApp:Admin:Invoice:'
Create NavigationFactory for main menu and register it in config.neon
class NavigationFactory implements \UltraScn\Admin\INavigationFactory { /** * @param int|string|NULL $userId */ public function create($userId) { $navigation = new \Inteve\Navigation\Navigation; $navigation->addPage('/', 'Dashboard', 'Admin:Dashboard:'); $navigation->addPage('users', 'Users', 'Admin:User:'); $navigation->addPage('users/roles', 'Roles', 'Admin:UserRole:'); return $navigation; } }
Create SignFormFactory and register it in config.neon
class SignFormFactory implements UltraScn\Admin\Forms\ISignFormFactory { // ... }
Or use default UltraScn\Admin\Forms\SignFormFactory
.
Create implementation of Nette\Security\IAuthenticator and register it in config.neon
Or use simple Nette implementation:
security:
users:
admin: password
Create SignPresenter
class SignPresenter extends \UltraScn\Admin\Presenters\SignPresenter { }
Create presenters for your admin interface
class DashboardPresenter extends \UltraScn\Admin\Presenters\SecuredPresenter { } class UserPresenter extends \UltraScn\Admin\Presenters\SecuredPresenter { }
License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/