chomenko / app-webloader
Installs: 460
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:extensions
Requires
- php: >=7.1
- janmarek/webloader: >=2.5
- joseki/webloader-filters: ^1.1
- mobiledetect/mobiledetectlib: >=2.8
- nette/application: >=2.4
- nette/di: >=2.4
- oyejorge/less.php: v1.7.0.14
This package is auto-updated.
Last update: 2024-11-10 06:43:58 UTC
README
Extension based on janmarek/webloader.
Allows you to add styles and scripts during an application.
Install
composer require chomenko/app-webloader
Configure
First look how to set up correctly janmarek/webloader.
in BasePresenter.php
<?php namespace App; use Nette\Application\UI\Presenter; use Chomenko\AppWebLoader\WebLoader; class BasePresenter extends Presenter { use WebLoader; }
in @layout.latte
<!DOCTYPE html> <html> <head> {control css} </head> <body class="skin-purple sidebar-mini fixed"> {include content} {control footerCss} {control js} </body> </html>
Use
in factory
<?php namespace App; use Chomenko\AppWebLoader\AppWebLoader; class SignInFactory{ public function __construct(AppWebLoader $webLoader) { $collection = $webLoader->createCollection("signIn"); $collection->addStyles(__DIR__ . "/../Assets/login.css"); $collection->addScript(__DIR__ . "/../Assets/login.js"); } public function create() { //... } }