2017 © Pedro Peláez
 

library nette-manager

Tools for managing of web resources under Nette Framework

image

web-resources/nette-manager

Tools for managing of web resources under Nette Framework

  • Wednesday, June 18, 2014
  • by mishak87
  • Repository
  • 2 Watchers
  • 5 Stars
  • 64 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Web Resources not only for Nette Framework

Main purpose is to simplify management of scripts and styles by moving their definition to configs (of modules) and supporting automated generation of content., (*1)

EXPERIMENTAL! BC breaks might occur. This is still more of a draft then proper code so please bear with me., (*2)

Installation

Add to your composer.json requirement "web-resources/nette-manager": "dev-master". Directory %WWW_DIR%/assets must be writable by server (can be changed in config)., (*3)

Bootstrap

$configurator = new Nette\Config\Configurator;
// after the line above
WebResources\NetteManager\DI\WebResourcesExtension::register($configurator);
// before the line bellow
$container = $configurator->createContainer();

In template

<head>
    ...
    {include ../../libs/web-resources/nette-manager/@styles.latte}
</head>

<body>
    ...
    {include ../../libs/web-resources/nette-manager/@scripts.latte}
</body>

Capabilities

  • dependency management

Scripts

  • translations
  • per script configuration
  • using public, minified and raw version of script based on debugMode and config

Styles

  • support for less (you must have lessc in path)
  • extracting resources to new folders to prevent caching issues using new url
  • renaming file to prevent caching issues
  • generating of gzipped files - can be used by nginx using gzip_static on;

Usage

In config.neon:, (*4)

resources:

    styles:
        bootstrap:
            filename: %appDir%/../libs/twitter/bootstrap/less/bootstrap.less
        bootstrap.responsive:
            filename: %appDir%/../libs/twitter/bootstrap/less/responsive.less
            depends: bootstrap

    scripts:
        jquery:
            filename: jquery-1.8.2.js
            public: //ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js
        bootstrap:
            filename: bootstrap.js
            minified: bootstrap.min.js
            depends: jquery
        main:
            filename: main.js
            depends: [ jquery, bootstrap ]
  • attribute depends is optional, defaults to empty array ([ ])

Scripts

  • minified version is optional
  • at least filename or public must be defined
  • switching between is done automatically in this order (productionMode = TRUE) public > minified > filename (debugMode = TRUE)

The Versions

18/06 2014

dev-feature_themes

dev-feature_themes

Tools for managing of web resources under Nette Framework

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

style resource manager nette scripts

16/05 2014

dev-master

9999999-dev

Tools for managing of web resources under Nette Framework

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

style resource manager nette scripts

16/05 2014

0.1.0

0.1.0.0

Tools for managing of web resources under Nette Framework

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

style resource manager nette scripts

28/04 2014

dev-feature_providers

dev-feature_providers

Tools for managing of web resources under Nette Framework

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

style resource manager nette scripts

28/04 2014

0.0.1

0.0.1.0

Tools for managing of web resources under Nette Framework

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

style resource manager nette scripts