|
Prismic.io PHP kit
3.0.0
|
Public Member Functions | |
| __construct ($main, $views=array()) | |
| asHtml ($linkResolver=null) | |
| asText () | |
| getView ($key) | |
| getMain () | |
| getViews () | |
| getUrl () | |
| getAlt () | |
| getCopyright () | |
| getWidth () | |
| getHeight () | |
| getLink () | |
This class embodies an Image fragment. 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\Image::__construct | ( | $main, | |
$views = array() |
|||
| ) |
Constructs an image fragment.
| \Prismic\Fragment\ImageView | $main | the main view of the image |
| array | $views | the associative array of objects |
| Prismic\Fragment\Image::asHtml | ( | $linkResolver = null | ) |
Builds a HTML version of the Image fragment (using just the main view)
| \Prismic\LinkResolver | $linkResolver | the link resolver |
Implements Prismic\Fragment\FragmentInterface.
| Prismic\Fragment\Image::asText | ( | ) |
Builds a text version of the Image fragment (simply returns its URL)
Implements Prismic\Fragment\FragmentInterface.
| Prismic\Fragment\Image::getAlt | ( | ) |
Returns the alternative text of the main view.
| Prismic\Fragment\Image::getCopyright | ( | ) |
Returns the copyright text of the image view.
| Prismic\Fragment\Image::getHeight | ( | ) |
Returns the height of the image view.
| Prismic\Fragment\Image::getLink | ( | ) |
Returns the link to point to
| Prismic\Fragment\Image::getMain | ( | ) |
Returns the main image view
| Prismic\Fragment\Image::getUrl | ( | ) |
Returns the URL of the main view.
| Prismic\Fragment\Image::getView | ( | $key | ) |
Returns an image view from its name (for instance, "icon", "large", ...)
| string | $key | the name of the view |
| Prismic\Fragment\Image::getViews | ( | ) |
Returns an associative array of all the views for this image but the main one.
| Prismic\Fragment\Image::getWidth | ( | ) |
Returns the width of the image view.
1.8.12