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

Flextype Core: Glide/Intervention Image Implementation #61

This commit is contained in:
Awilum
2019-01-04 02:53:35 +03:00
parent eb9b2993a1
commit 06294769d0

View File

@@ -27,9 +27,9 @@ class Images
private static $instance = null;
/**
* Cache Driver
* Images Server
*
* @var DoctrineCache
* @var
*/
protected static $server;
@@ -62,7 +62,7 @@ class Images
}
/**
* Init Themes
* Init Images
*
* @access private
* @return void
@@ -120,11 +120,32 @@ class Images
Images::$server = $server;
}
/**
* Get image
*
* Images::get('page-name/image.jpg', [w => '200']);
*
* @access public
* @param string $path Image path
* @param array $params Image params
* @return string Returns the image url
*/
public static function get($path, $params)
{
return Http::getBaseUrl().'/site/cache/glide/'.Images::$server->makeImage($path, $params);
}
/**
* Returns server variable
*
* @access public
* @return object
*/
public static function server()
{
return Images::$server;
}
/**
* Get the Image instance.
*