Download the PHP package adhocore/twig-yall without Composer

On this page you can find all versions of the php package adhocore/twig-yall. 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 twig-yall

adhocore/twig-yall

It is a twig extension around malchata/yall.js for lazy loading img, picture, video, iframe etc.

(Also supports source tag and srcset attribute).

Latest Version Travis Build Scrutinizer CI Codecov branch StyleCI

Eager loading of images and videos not only makes webpage slow and clumsy but also consumes a lot of bandwidth.

If you use twig templating system for your view layer, this extension defers loading of resources so they are loaded only when required in viewport.

Installation

Usage

First setup twig to register this extension:

Voila, then in twig templates you would either use {% lazyload %} block to lazyload whole block at once OR individually lazyload each resources with {{ lazify() }}.

In both cases, you must call {{ yallify() }} somewhere at the footer.

lazyload

With placeholder config set to 'default.png', below template

will be rendered as:

lazify

only src

will be rendered as:

See stackoverflow for the usage of data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEAAAAALAAAAAABAAEAAAI=.

with class

will be rendered as:

custom placeholder

will be rendered as:

video poster

will be rendered as:

source tag

will be rendered as:

src+srcset

will be rendered as:

yallify

Important: Do not forget to put the yall loader somewhere in the footer twig template:

Which by default loads yall 3.1.7 with polyfills. You can set yall.js version, and turn off polyfill like so:

You can pass yall options in third param. For event callbacks wrap it in <raw></raw>:

will be rendered as:

PS: The inputs sent to lazify() or yallify() are not validated by this library.

From malchata/yall.js:

Use appropriate width and height attributes, styles, and lightweight placeholders for your images.

Contributing

Please check the guide

LICENSE

© MIT | 2019, Jitendra Adhikari


All versions of twig-yall with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
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 adhocore/twig-yall contains the following files

Loading the files please wait ....