$dimension->fitWidth()

Fits the width by the given value and returns a modified dimension object

  • return ($image)

Example

<?php

$image = $page->image();
$image->dimensions()->fitWidth(300);

echo html::tag('img', array(
  'src'    => $image->url(),
  'width'  => $image->width(),
  'height' => $image->height()
));

?>

Is something missing or incorrect? Edit this page on Github…