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:
@@ -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) . '">';
|
||||
|
Reference in New Issue
Block a user