2017 © Pedro Peláez
 

library header

Component for generating beuty and corect html header with only files where are realy required.

image

rm/header

Component for generating beuty and corect html header with only files where are realy required.

  • Saturday, June 2, 2018
  • by romanmatyus
  • Repository
  • 4 Watchers
  • 9 Stars
  • 512 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 8 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

Header

Component for generating beuty and corect html header with included AssetsCollector., (*1)

Is fork of http://github.com/ondrejmirtes/nette-headercontrol., (*2)

License: MIT, (*3)

Requirements

  • PHP 5.3
  • Nette 2.0.5 - https://github.com/nette/nette

Details

http://forum.nette.org/cs/12704-dynamicke-vkladanie-iba-pouzitych-css-a-js-suborov, (*4)

Add macros

Usable in view or components., (*5)

{css "grid.css"} {* Find in drirectory <directory with template>/screen.css *}
{css "screen.css"} {* Find in drirectory $csspath/screen.css *}
{css "/var/www/sk/web/www/style/css/screen.css"} {* Find in drirectory "/var/www/sk/web/www/style/css/screen.css" *}
{js "live-form-validation.js"}
{js "jquery.min.js", "jquery.nette.js", "jquery.ajaxform.js"} {* definition with dependency *}

{cssContent}
* { color:red}
{/cssContent}

{jsContent}
$( 'textarea.editor' ).ckeditor();
{/jsContent}

Packages

For often usable files exist option for simple definition packages of files., (*6)

Example

Define in config.neon:, (*7)

common:
    assetsCollector:
        packages:
            jQuery:
                js:
                    - %wwwDir%/style/js/jquery-1.8.2.min.js
            netteForms:
                js:
                    - %wwwDir%/libs/Nette-extras/Niftyx-NiftyGrid-5163290/resources/js/netteForms.js
            jQueryUI:
                extends:
                    - jQuery
                css:
                    - %wwwDir%/libs/jquery-ui-1.9.1.custom/css/smoothness/jquery-ui-1.9.1.custom.min.css
                js:
                    - %wwwDir%/libs/jquery-ui-1.9.1.custom/js/jquery-ui-1.9.1.custom.min.js
            NiftyGrid:
                extends:
                    - jQueryUI
                    - netteForms
                css:
                    - %wwwDir%/libs/Nette-extras/Niftyx-NiftyGrid-5163290/resources/css/grid.css
                js:
                    - %wwwDir%/libs/Nette-extras/Niftyx-NiftyGrid-5163290/resources/js/grid.js

Use in latte templates:, (*8)

{pfpack "NiftyGrid"}

Compilators

On a CSS and JS files can be aplied compilators., (*9)

Example

In config.neon:, (*10)

common:
    assetsCollector:
        addCssCompilator:
            - @superExtraCompilator
    enabledCompilers:
        - cssSimpleMinificator
        - imageToDataStream
        - imageReplacer
        - superExtraCompilator
    services:
        superExtraCompilator:
            class: SuperExtraCompilator

Installation

1) Download, (*11)

2) Unpack, (*12)

3) Register, (*13)

\RM\AssetsCollector\AssetsCollectorExtension::register($configurator);

4) Create component Header https://github.com/romanmatyus/Header, (*14)

5) Change file @layout.latte such as this:, (*15)

{capture $html}
<body>
...
</body>
</html>
{/capture}
{control header}
{!$html}

6) Use it:), (*16)

Roadmap

  • FIX ->setAssetsCollector($this->context->assetsCollector->collector) in documentation. Issue #2
  • Add description for creating component header to documentation. Issue #3
  • Call compilers by order in variable enabledCompilers. Issue #1
  • Add macros for changing meta information from templates. Issue #4
  • 2012-11-14 FIX Lazy compile
  • 2012-11-13 Lazy compile
  • 2012-11-13 FIX enabledCompilers for JS
  • 2012-11-12 BC! Change name of macro pfpack to pack

The Versions

02/06 2018

dev-master

9999999-dev https://github.com/romanmatyus/Header

Component for generating beuty and corect html header with only files where are realy required.

  Sources   Download

MIT

The Requires

 

02/06 2018

v0.2.4

0.2.4.0 https://github.com/romanmatyus/Header

Component for generating beuty and corect html header with only files where are realy required.

  Sources   Download

MIT

The Requires

 

12/02 2016

0.2.2

0.2.2.0 https://github.com/romanmatyus/Header

Component for generating beuty and corect html header with only files where are realy required.

  Sources   Download

MIT

The Requires

 

26/01 2016

0.2.1

0.2.1.0 https://github.com/romanmatyus/Header

Component for generating beuty and corect html header with only files where are realy required.

  Sources   Download

MIT

The Requires

 

18/12 2015

0.2.0

0.2.0.0 https://github.com/romanmatyus/Header

Component for generating beuty and corect html header with only files where are realy required.

  Sources   Download

MIT

The Requires

 

14/04 2015

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1 https://github.com/romanmatyus/Header

Component for generating beuty and corect html header with only files where are realy required.

  Sources   Download

MIT

The Requires

 

07/04 2015

v0.1

0.1.0.0 https://github.com/romanmatyus/Header

Component for generating beuty and corect html header with only files where are realy required.

  Sources   Download

MIT

The Requires