PHP Class size, kirby

Inheritance: extends Controller
Show file Open project: bastianallgeier/kirby Class Usage Examples

Public Methods

Method Description
fit ( integer $width, integer $height, integer $box, boolean $force = false ) : array Fits width and height into a defined box and keeps the ratio
fit_height ( integer $width, integer $height, integer $fit, boolean $force = false ) : array Fits width and height by a passed height and keeps the ratio
fit_width ( integer $width, integer $height, integer $fit, boolean $force = false ) : array Fits width and height by a passed width and keeps the ratio
ratio ( integer $width, integer $height ) : float Gets the ratio by width and height

Method Details

fit() static public method

Fits width and height into a defined box and keeps the ratio
static public fit ( integer $width, integer $height, integer $box, boolean $force = false ) : array
$width integer
$height integer
$box integer
$force boolean If width and height are smaller than the box this will force upscaling
return array An array with a key and value for width and height

fit_height() static public method

Fits width and height by a passed height and keeps the ratio
static public fit_height ( integer $width, integer $height, integer $fit, boolean $force = false ) : array
$width integer
$height integer
$fit integer The new height
$force boolean If width and height are smaller than the box this will force upscaling
return array An array with a key and value for width and height

fit_width() static public method

Fits width and height by a passed width and keeps the ratio
static public fit_width ( integer $width, integer $height, integer $fit, boolean $force = false ) : array
$width integer
$height integer
$fit integer The new width
$force boolean If width and height are smaller than the box this will force upscaling
return array An array with a key and value for width and height

ratio() static public method

Gets the ratio by width and height
static public ratio ( integer $width, integer $height ) : float
$width integer
$height integer
return float