drago-ex / project-front
The package adds a basic frontend module to Drago Project.
Package info
github.com/drago-ex/project-front
Type:drago-tools-resource
pkg:composer/drago-ex/project-front
Requires
- php: >=8.3 <9
- drago-ex/application: ^5.0
- drago-ex/permission: ^2.0
- drago-ex/translator: ^4.0.1
Requires (Dev)
- nette/tester: ^2.5
- phpstan/phpstan-nette: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The website module of Drago Project: BasePresenter with the ACL check, the front router with the languages
cs/en, a plain layout, the home page and the front.js/front.scss entry point. It is installed with
Drago Project.
Requirements
- PHP >= 8.3, < 9
- Drago Project
Installation
composer require drago-ex/project-front
Project Tools copies the files of the package into the project, where you adapt them.
Usage
The route [<lang=cs cs|en>/]<presenter>/<action> is added by Front/9.conf.neon, after the routes of the other
packages. Presenters of the website extend App\Presentation\BasePresenter.
For the website design with a navbar, the user menu and the blog on the home page, add Front UI.
Permissions
BasePresenter checks every presenter by the Authorization trait of
drago-ex/permission: its page and signals, with the presenter name as the
resource. A new presenter needs its resource, and a guest rule when it is public, in an acl.neon next to it;
otherwise it is denied. The rules of the home page are in Front/Home/acl.neon (resource Front:Home, everyone).
The same file describes the privileges (permissionLabels) for the permissions page of Project Permission.