weprovide / aviate
Connector class for Aviate compiler
Installs: 43 103
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 0
Open Issues: 0
This package is not auto-updated.
Last update: 2024-05-28 09:34:44 UTC
README
Implementation of Aviate for PHP. Provided as base abstract class to extend for specific frameworks.
Installation
composer require weprovide/aviate
Example
<?php namespace WeProvide\Aviate\CustomImplementation; use WeProvide\Aviate\Aviate; class Bridge extends Aviate { // Required function for you to implement. This should return the directory that has the aviate.config.js public function getProjectRoot(): string { return '/your-directory'; } // Used for convience / demonstration. This is not required public function isDevelopment(): bool { return true; } // Return a nested array with Javascript and CSS files to be included into the page public function getFiles(): array { $types = parent::getFiles(); if($this->isDevelopment()) { // In development css is injected from Javascript to provide hot reloading. $types['js'][] = $this->getDevServerUrl('css-file.js'); return $types; } // In production we load an actual CSS file $types['css'][] = 'css-file.css'; return $types; } }