Download the PHP package wearebase/web-images without Composer

On this page you can find all versions of the php package wearebase/web-images. 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 web-images

Requirements

Install

composer require wearebase/web-images

Configure where you want the package to go

If you want to install somewhere other than vendor, in your composer.json add the following:

What's included

Usage

Enabling Views

First of all, you must add the views folder to your Twig template load path.

If you're not using Timber, then simply use lazyImages.twig as a universal Twig file.

Timber

Add the loadpath to your functions.php. You must re-add the default Theme view folder in here too as it may override the Timber view folder.

If you're using Timber, then use timberImages.twig.

Enabling Macros

In your layout file, or in individual macros or components:

{% import 'lazyImages.twig' as base_image %}

or if you're using Timber,

{% import 'timberImages.twig' as base_image %}

Enabling Sass

Enabling JS

Enabling background-size.

Background-size is now disabled by default. To use this, drop the background-size.min.htc file to your webroot.

You'll also need to add CSS rules to your background images in your own code to use it.

A reference to a htc file must be absolute.

LazyLoading

Macros

{{ base_image.lazy(images, alt, classes, width, height) }}

Bog standard lazy img. Give it the following vars:

There is also a standard 'img' macro if you need to switch a lazy image to a normal image tag.

{{ base_image.TimberImages(ids, alt, classes, sizes) }}

This is a preferable function if you know the ID of an image.

This is great for most scenarios, but a specific scenario might be that you have a 'banner' image size set up for your Wordpress images. You can then request the Featured Image of a post in the size 'banner'. Or if you're feeling fancy, add a 'banner-2x' and request ['banner', 'banner-2x'] to get a retina size of that banner.

Pass this the following vars:

{{ base_image.background(images, classes) }}

Pass this the following vars:


All versions of web-images with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ^1.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 wearebase/web-images contains the following files

Loading the files please wait ....