2017 © Pedro Peláez
 

library phly-requirejs

ZF2 view helper for aggregating RequireJs-compatible require statements

image

phly/phly-requirejs

ZF2 view helper for aggregating RequireJs-compatible require statements

  • Thursday, July 17, 2014
  • by weierophinney
  • Repository
  • 2 Watchers
  • 14 Stars
  • 42 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PhlyRequireJs

https://travis-ci.org/phly/PhlyRequireJs.svg?branch=master, (*1)

Simple library providing a ZF2 view helper for aggregating RequireJs calls., (*2)

Installation

Install the module via git submodules, unzipping the download zipball, or, later, via Composer., (*3)

Enable it in a ZF2 module by adding the "PhlyRequireJs" module to your config/application.config.php file., (*4)

If not using in ZF2, but standalone with the ZF2 PhpRenderer, you will need to add the requirejs helper as an invokable to the ViewHelperManager., (*5)

Usage

requirejs()->append('foo/bar'); 

// require(["foo/bar"], function (bar) { bar.baz(); });
$this->requirejs()->append('foo/bar', 'function (bar) { bar.baz(); }'); 

// Capture the callback
$this->requirejs()->appendAndCaptureCallback('foo/bar'); ?>
function(bar) {
    bar.baz();
    bar.onClick(bar.doSomething);
}
<?php
$this->requirejs()->stopCapture();

// Echo all requires
echo $this->requirejs();

The view helper also defines prepend and prependAndCaptureCallback methods; they work identically, but prepend the require to the start of the list., (*6)

LICENSE

BSD-2-Clause, (*7)

The Versions

17/07 2014

dev-master

9999999-dev https://github.com/weierophinney/PhlyRequireJs

ZF2 view helper for aggregating RequireJs-compatible require statements

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

zf2 zend module requirejs

17/07 2014

1.0.0

1.0.0.0 https://github.com/weierophinney/PhlyRequireJs

ZF2 view helper for aggregating RequireJs-compatible require statements

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

zf2 zend module requirejs