Download the PHP package jordanbeattie/craftcms-images without Composer

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

Image Optimization

Render images in your Craft templates with a single include. Pass in classes, fallbacks, transforms and more and have optimized images on your site compliant with Google Page Speed Insights.

Installation

Include the package in your project:

and install the plugin within the CMS.

Usage

Instead of writing out <img> tags in your project, pass variables to the render function which will optimize the image for you.

Variable Description
Field The CraftCMS field where users can upload a single image.
Transform The handle or attributes of an image transform to use. *See transforms.
Fallback A static URL/path to an image that can be used if there is an issue rendering the image or if the field is empty.
Class Any classes that should be added to the tag
Style Any items to be included in the style attributes
Alt Text for the alt attribute. If none is supplied and the field variable is passed, the alt text from the image model will be used.
Attributes Any other attributes to be added to the tag. This should be an array. * See attributes.

Transforms

Including transforms is the best way to serve images. You can pass the transform handle through to the include. The plugin will look for the transform with the handle provided and also a mobile version which should have the same handle appended with "Mobile". e.g. myTransformHandle and myTransformHandleMobile. You can also pass in the transform manually to avoid creating them in the CMS. See examples below. If you do not specify a format for your transformed image and the server supports WebP, the image will be returned as a WebP to accomodate best web practices.

Attributes

Often, when using third-party packages such as MatchHeight, you will need to add custom attributes. These can be passed in as an array.

Returning a URL

Only want to return a URL for the image? Use the URL function instead of render and simply pass in the image and transform and optional fallback image. See examples below

Examples

Full parameters

Image without transform

Static image

Replacing an existing img tag

should be replaced with

or with a transform

Returning a URL

Contact

Jordan Beattie
[email protected]
www.jordanbeattie.com


All versions of craftcms-images with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^4.0.0-alpha
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 jordanbeattie/craftcms-images contains the following files

Loading the files please wait ....