Prismic.io PHP kit  3.0.0
Public Member Functions | List of all members
Prismic\Fragment\BlockGroup Class Reference

Public Member Functions

 __construct ($maybeTag, $blocks)
 
 asText ()
 
 asHtml ($linkResolver=null)
 
 addBlock ($block)
 
 getTag ()
 
 getBlocks ()
 

Detailed Description

This class embodies a group of StructuredText blocks. This is only for internal use, when a StructuredText fragment gets rendered as HTML: the first thing that happens is that StructuredText blocks get grouped together, so that list-items can later be serialized with a

and a after, for instance. This is the data structure that allows that temporary storage.

Constructor & Destructor Documentation

§ __construct()

Prismic\Fragment\BlockGroup::__construct (   $maybeTag,
  $blocks 
)

Constructs a group of StructuredText blocks

Parameters
string$maybeTagthe tag to use if should be (values are either "ul", "ol" or null)
array$blocksthe array of BlockInterface objects that are being grouped here

Member Function Documentation

§ addBlock()

Prismic\Fragment\BlockGroup::addBlock (   $block)

Adds a block to the group of blocks.

Parameters
\Prismic\Fragment\Block\BlockInterface$blockthe block to add

§ asHtml()

Prismic\Fragment\BlockGroup::asHtml (   $linkResolver = null)

Supposedly, should render the group as HTML; really, returns null, as there's no reason to render it as HTML.

Parameters
\Prismic\LinkResolver$linkResolvera link resolver
Returns
string null in all cases

§ asText()

Prismic\Fragment\BlockGroup::asText ( )

Supposedly, should render the group as text; really, returns null, as there's no reason to render it as text.

Returns
string null in all cases

§ getBlocks()

Prismic\Fragment\BlockGroup::getBlocks ( )

Returns the array of BlockInterface objects that are being grouped here

Returns
array the array of BlockInterface objects that are being grouped here

§ getTag()

Prismic\Fragment\BlockGroup::getTag ( )

Returns the tag to use if should be (values are either "ul", "ol" or null).

Returns
string the tag to use if should be (values are either "ul", "ol" or null).

The documentation for this class was generated from the following file: