PHP Class Bootstrapper\MediaObject

Inheritance: extends bootstrapper\RenderedObject
Show file Open project: patricktalmadge/bootstrapper Class Usage Examples

Protected Properties

Property Type Description
$contents The contents of the media object
$list Whether the list

Public Methods

Method Description
asList ( ) Force the media object to become a list
render ( ) : string Renders the media object
withContents ( array $contents ) Sets the contents of the media object

Protected Methods

Method Description
getBody ( array $contents ) : string Get the body of the contents array
getHeading ( array $contents ) : string Get the heading of the media object
getImage ( array $contents, string $alt ) : string Get the image of the media object
getLink ( array $contents, string $image, string $position ) : string Turn the image into a link/div
getPosition ( array $contents ) : string Get the position
renderItem ( array $contents, string $tag ) : string Renders an item in the string
renderList ( ) : string Renders a list

Method Details

asList() public method

Force the media object to become a list
public asList ( )

getBody() protected method

Get the body of the contents array
protected getBody ( array $contents ) : string
$contents array
return string

getHeading() protected method

Get the heading of the media object
protected getHeading ( array $contents ) : string
$contents array
return string

getImage() protected method

Get the image of the media object
protected getImage ( array $contents, string $alt ) : string
$contents array
$alt string The alt text of the image
return string

getPosition() protected method

Get the position
protected getPosition ( array $contents ) : string
$contents array
return string pull-right if the position key equals right. pull-left otherwise

render() public method

Renders the media object
public render ( ) : string
return string

renderItem() protected method

Renders an item in the string
protected renderItem ( array $contents, string $tag ) : string
$contents array
$tag string The tag to wrap the item in
return string

renderList() protected method

Renders a list
protected renderList ( ) : string
return string

withContents() public method

Sets the contents of the media object
public withContents ( array $contents )
$contents array The contents of the media object

Property Details

$contents protected property

The contents of the media object
protected $contents

$list protected property

Whether the list
protected $list