https://github.com/juniwalk/tessa
https://github.com/juniwalk/tessa
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/juniwalk/tessa
- Owner: juniwalk
- Created: 2018-12-13T11:35:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-05T11:10:11.000Z (about 2 years ago)
- Last Synced: 2025-07-20T10:09:02.328Z (11 months ago)
- Language: PHP
- Size: 122 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Installation
To install latest version of `juniwalk/tessa` use [Composer](https://getcomposer.org).
```bash
composer require juniwalk/tessa
```
### Usage
Check [config.neon](tests/config.neon) from tests for more details.
```neon
extensions:
tessa: JuniWalk\Tessa\DI\TessaExtension
tessa:
outputDir: %wwwDir%/static
checkLastModified: true
default:
defer: true
assets:
- %moduleDir%/font-awesome/css/font-awesome.min.css
- %moduleDir%/jquery/dist/jquery.min.js
- %moduleDir%/bootstrap/dist/css/bootstrap.min.css
- %moduleDir%/bootstrap/dist/js/bootstrap.min.js
- %moduleDir%/nette-forms/src/assets/netteForms.min.js
- %wwwDir%/assets/style.css
- %wwwDir%/assets/index.js
frontend:
extend: default
assets: []
backend:
extend: default
assets:
- %wwwDir%/assets/admin.js
fullcalendar:
defer: true
assets:
- %moduleDir%/fullcalendar/index.global.min.js
```
Include `AssetManager` trait to get access to Tessa component.
```php
use JuniWalk\Tessa\Attributes\AssetBundle;
use JuniWalk\Tessa\Traits\AssetManager;
#[AssetBundle('frontend')]
class TessaPresenter extends Presenter
{
use AssetManager;
#[AssetBundle('calendar')]
public function actionCalendar(): void {}
}
```
Then render styles and scripts in template from Presenter attributes.
```latte
Tessa example
{control tessa:css}
{control tessa:js}
```
Alternatively you can render specific part of bundle.
```latte
Render just fullcalendar scripts
{control tessa:js 'fullcalendar'}
```