1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-12 08:04:05 +02:00

Flextype Core: New Images API

This commit is contained in:
Awilum
2019-02-20 14:19:35 +03:00
parent b5f20aac3f
commit 6c6342c77d

View File

@@ -18,7 +18,7 @@ use Flextype\Component\Html\Html;
class Images
{
/**
* An instance of the Themes class
* An instance of the Images class
*
* @var object
*/
@@ -119,9 +119,9 @@ class Images
}
/**
* Get image url
* Fetch image url
*
* Images::getImageUrl('page-name/image.jpg', [w => '200']);
* Images::fetchImageUrl('page-name/image.jpg', [w => '200']);
* http://glide.thephpleague.com/1.0/api/quick-reference/
*
* @access public
@@ -129,7 +129,7 @@ class Images
* @param array $params Image params
* @return string
*/
public static function getImageUrl(string $path, array $params) : string
public static function fetchImageUrl(string $path, array $params) : string
{
if (file_exists(PATH['entries'] . '/' . $path)) {
return Http::getBaseUrl() . '/site/cache/glide/' . Images::$server->makeImage($path, $params);
@@ -139,9 +139,9 @@ class Images
}
/**
* Get image
* Fetch image
*
* Images::getImage('page-name/image.jpg', [w => '200']);
* Images::fetchImage('page-name/image.jpg', [w => '200']);
* http://glide.thephpleague.com/1.0/api/quick-reference/
*
* @access public
@@ -150,7 +150,7 @@ class Images
* @param array $attributes Image html attributes
* @return string
*/
public static function getImage(string $path, array $params, array $attributes = []) : string
public static function fetchImage(string $path, array $params, array $attributes = []) : string
{
if (file_exists(PATH['entries'] . '/' . $path)) {
return '<img ' . Html::attributes($attributes) . ' src="' . Images::getImageUrl($path, $params) . '">';