|
Prismic.io PHP kit
3.0.0
|
Public Member Functions | |
| __construct ($url, $alt, $copyright, $width, $height, $link) | |
| asHtml ($linkResolver=null, $attributes=array()) | |
| ratio () | |
| getUrl () | |
| getAlt () | |
| getCopyright () | |
| getWidth () | |
| getHeight () | |
| getLink () | |
Static Public Member Functions | |
| static | parse ($json) |
This class embodies an image view. An image in prismic.io is made of views: a main unnamed one, and optional named ones. Typically, views are different sizes of the same image ("icon", "large", ...), but not necessarily.
| Prismic\Fragment\ImageView::__construct | ( | $url, | |
| $alt, | |||
| $copyright, | |||
| $width, | |||
| $height, | |||
| $link | |||
| ) |
Constructs an image view.
| string | $url | the image view's URL |
| string | $alt | the image view's alternative text |
| string | $copyright | the image view's copyright |
| int | $width | the image view's width |
| int | $height | the image view's height |
| LinkInterface | $link | the image view's link to point to |
| Prismic\Fragment\ImageView::asHtml | ( | $linkResolver = null, |
|
$attributes = array() |
|||
| ) |
Builds a HTML version of the image view.
| \Prismic\LinkResolver | $linkResolver | the link resolver |
| array | $attributes | associative array of HTML attributes to add to the tag |
| Prismic\Fragment\ImageView::getAlt | ( | ) |
Returns the alternative text of the image view.
| Prismic\Fragment\ImageView::getCopyright | ( | ) |
Returns the copyright text of the image view.
| Prismic\Fragment\ImageView::getHeight | ( | ) |
Returns the height of the image view.
| Prismic\Fragment\ImageView::getLink | ( | ) |
Returns the link to point to
| Prismic\Fragment\ImageView::getUrl | ( | ) |
Returns the URL of the image view.
| Prismic\Fragment\ImageView::getWidth | ( | ) |
Returns the width of the image view.
|
static |
Parses a given image view fragment. Not meant to be used except for testing.
| \stdClass | $json | the json bit retrieved from the API that represents an image view. |
| Prismic\Fragment\ImageView::ratio | ( | ) |
Returns the ratio of the image view.
1.8.12