Download the PHP package imponeer/smarty-image without Composer
On this page you can find all versions of the php package imponeer/smarty-image. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download imponeer/smarty-image
More information about imponeer/smarty-image
Files in imponeer/smarty-image
Package smarty-image
Short Description Smarty plugin that adds some image related template syntax enchaments
License MIT
Informations about the package smarty-image
Smarty Image
Some Smarty syntax plugins for operations with images.
Installation
To install and use this package, we recommend to use Composer:
Otherwise, you need to include manually files from src/
directory.
Registering in Smarty
If you want to use these extensions from this package in your project you need register them with registerPlugin
function from Smarty. For example:
Using from templates
To resize images from smarty You can use resized_image function:
This function supports such arguments:
Argument | Required | Default value | Description |
---|---|---|---|
file |
yes | Image file to resize | |
width |
if height is not specified |
Resized image width | |
height |
if width is not specified |
Resized image height | |
fit |
no | outside |
Method used for resize. Supported fill , inside , outside |
href or link |
no | if specified and return is set to image , will output generated HTML as image with link to this specific location |
|
basedir |
no | $_SERVER['DOCUMENT_ROOT'] | Base dir where to look for image files |
return |
no | image |
Returns result as HTML tag if value is image , or as resized image URI if value is url . |
All extra arguments will be rendered into image tag, if return mode is image
.
How to contribute?
If you want to add some functionality or fix bugs, you can fork, change and create pull request. If you not sure how this works, try interactive GitHub tutorial.
If you found any bug or have some questions, use issues tab and write there your questions.
All versions of smarty-image with dependencies
imponeer/smarty-extensions-contracts Version ^3.0
intervention/image Version ^2.5
psr/cache Version ^1.0|^2.0|^3.0
ext-json Version *