PHP Класс PHPFusion\ImageRepo

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
getFileList ( $path ) : array Given a path, returns an array of all files
getImage ( string $image, string $alt = "", string $style = "", string $title = "", string $atts = "" ) : string Get the imagepath or the html "img" tag
getImagePaths ( ) : string[] Get all imagepaths
replaceInAllPath ( string $source, string $target ) Replace a part in each path
setImage ( string $name, string $path ) Set a path of an image

Приватные методы

Метод Описание
cache ( ) Fetch and cache all off the imagepaths

Описание методов

getFileList() публичный статический Метод

Given a path, returns an array of all files
public static getFileList ( $path ) : array
$path
Результат array

getImage() публичный статический Метод

Get the imagepath or the html "img" tag
public static getImage ( string $image, string $alt = "", string $style = "", string $title = "", string $atts = "" ) : string
$image string The name of the image.
$alt string "alt" attribute of the image
$style string "style" attribute of the image
$title string "title" attribute of the image
$atts string Custom attributes of the image
Результат string The path of the image if the first argument is given, but others not. Otherwise the html "img" tag

getImagePaths() публичный статический Метод

Get all imagepaths
public static getImagePaths ( ) : string[]
Результат string[]

replaceInAllPath() публичный статический Метод

Replace a part in each path
public static replaceInAllPath ( string $source, string $target )
$source string
$target string

setImage() публичный статический Метод

Set a path of an image
public static setImage ( string $name, string $path )
$name string
$path string