2017 © Pedro Peláez
 

library php-simple-static-manager

Simple static manager

image

alexpts/php-simple-static-manager

Simple static manager

  • Tuesday, September 5, 2017
  • by alexpts
  • Repository
  • 1 Watchers
  • 1 Stars
  • 84 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

php-simple-static-manager

SensioLabsInsight, (*1)

Build Status Test Coverage Code Climate Scrutinizer Code Quality, (*2)

Installation

$ composer require alexpts/php-simple-static-manager

Пример

$staticManager = new StaticManager(new Collection);
$css = $staticManager->getCssSet();
$js = $staticManager->getJsHeaderSet();

$package = new Package(new StaticVersionStrategy('v1'));

$css->addItem('bootstrap2', $package->getUrl('/bootstrap/3.3.6/css/bootstrap.css'));
$css->addItem('bootstrap', '/bootstrap/3.3.6/css/bootstrap.min.css', 90);
$css->addItem('bootstrap', ['href' => '/bootstrap/3.3.6/css/bootstrap.min.css', 'rel' => 'less'], 90);

$js->addItem('vue.js', ['src' => '/vue.min.js', 'type' => 'module'], 100);
$js->addItem('vue-router.js', '/vue-router.min.js');
$js->addItem('vue-router.js', 'https://yandex.st/vue-resource.min.js', 10); // cdn

echo $staticManager->drawStyles();

Вы можете зарегистрировать js/css ресурс с определенным приоритетом. Это позволяет загрузить библиотеки, вроде jquery с высшим приоритетом до вашего кода. При этом объявить зависимость в коде можно где угодно и в любом порядке., (*3)

Коллекция ресурсов представлена объектом коллекции: https://github.com/alexpts/php-tools/blob/master/docs/collection.md, (*4)

The Versions

05/09 2017

dev-master

9999999-dev https://github.com/alexpts/php-simple-static-manager

Simple static manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar alexpts

css asset js static package resources

05/09 2017

1.2.1

1.2.1.0 https://github.com/alexpts/php-simple-static-manager

Simple static manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar alexpts

css asset js static package resources

05/06 2017

1.2.0

1.2.0.0 https://github.com/alexpts/php-simple-static-manager

Simple static manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar alexpts

css asset js static package resources

22/10 2016

1.1.0

1.1.0.0 https://github.com/alexpts/php-simple-static-manager

Simple static manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar alexpts

css asset js static package resources

24/09 2016

1.0.1

1.0.1.0 https://github.com/alexpts/php-simple-static-manager

Simple static manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar alexpts

css asset js static resources

18/09 2016

1.0.0

1.0.0.0 https://github.com/alexpts/php-simple-static-manager

Simple static manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar alexpts

css asset js static resources