An open API service indexing awesome lists of open source software.

https://github.com/juniwalk/tessa


https://github.com/juniwalk/tessa

Last synced: 4 months ago
JSON representation

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'}

```