Download the PHP package kinglozzer/yepnopesilverstripe without Composer

On this page you can find all versions of the php package kinglozzer/yepnopesilverstripe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yepnopesilverstripe

YepnopeSilverStripe

Build Status Latest Stable Version License

A module to allow loading of Javascript & CSS using the conditional loader yepnopejs.

By: Loz Calver & Colin Richardson - Bigfork Ltd.

About yepnope:

"yepnope is an asynchronous conditional resource loader that's super-fast, and allows you to load only the scripts that your users need."

Installation:

Composer:

Download:

Simply clone or download this repository and put it in a folder called 'yepnopesilverstripe' in your SilverStripe installation folder, then run dev/build.

Examples:

Add files:

The simplest way to add a file, or multiple files, whether they're Javascript or CSS, is to use the add_files() function in your Page_Controller:

The above example would output the following:

Callbacks:

You can specify a callback function (called for each file that's loaded) and/or a complete function (called after all files have been loaded) by passing second and third arguments to the add_files() function:

The above example would output the following:

Tests:

You can make use of yepnope's test functionality with the add_test() function. Arguments must be passed in the following order:

Example test:

The above example would output the following:

The lists of files passed to the function can be either strings, arrays or null (for example, if no extra files are needed for the 'yep' argument).

Clear files & tests:

Both the add_files() and add_test() methods take an optional, last argument (4th and 7th arguments respectively) for a unique identifier. This identifier can then be used to remove a test on certain pages. In the example below, let's assume you have files you want to load on every page except pages with the 'ContactPage' page type:

Override test parameters:

If you specify indentifiers for your tests, you can override individual parameters on an already existing test. The following example would use the 'complete' function pageInit() on pages with the 'Page' pagetype, and contactPageInit() on pages with the 'ContactPage' pagetype.

The list of methods that can be used when overriding test properties is as follows:

Resource callback labels:

Since version 1.5 of yepnope.js, keys to be used in callbacks are automatically generated from the basename of the file. If you require keys to be used in your callback functions, please use these generated keys as per the example below:

Customise:

If you're already using yepnope or modernizr and don't need to include yepnope.js, you can remove the requirement (or set it to use a different script) with the following:

If you wish to specify a custom error timeout length (yepnope's default is 10 seconds) you can use the set_timeout() method. Note that the time is set in milliseconds:

YepnopeSilverStripe automatically evaluates tests after Controller::init(), using the Controller->onAfterInit() extension hook. This behaviour can be disabled by calling Yepnope::set_automatically_evaluate(false);. You can then manually evaluate your Yepnope tests by calling Yepnope::eval_yepnope() with one, optional parameter for a 'customScriptID' (YepnopeSilverStripe uses Requirements::customScript()).

Tips:

If your tests, callback functions or complete functions are quite long, then putting them in a PHP file is ugly and hard to maintain. One alternative is to store the raw javascript in a template (be sure to do a ?flush=1 after creating any templates) and load it using the following method:

MyCallback.ss would then contain your raw Javascript (not wrapped in any HTML tags or anything).

Todo:


All versions of yepnopesilverstripe with dependencies

PHP Build Version
Package Version
Requires silverstripe/framework Version ~3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kinglozzer/yepnopesilverstripe contains the following files

Loading the files please wait ....