Bulleted Lists

The bulleted list consists of an abstract base class and two child classes, OrderedList and UnorderedList.

In order to construct any bulleted list class, you must supply an Clio object, which should be one instance representing the physical terminal.

Markup can be placed in the text to trigger styling embedded in the text.

Lists can be nested by use of the start() and stop() pair. Here is an example of an Unordered List. Note: The HTML class comes with a default markup symbol "**" which means bolding.


    $ul = new UnorderedList($html);

    $ul->start("Unordered List");
    $ul->li("One")->li("Another list item");
    $ul->start()->li("**Second level** of nesting caused")->end();
    $ul->end();
    
Unordered List
- One
- Another list item
   - Second level of nesting caused

Software Documentation

The two classes UnorderedList and OrderedList have the same methods as dictated by the abstract base class.

The following sections lists the software documentation for:

Bulleted Class

BulletedList is the abstract base class for UnorderedList and OrderedList, so it should not be used directly.

Constructor


Constructor for all Bulleted List classes. Pass in the Clio object (which should have one instance to represent the physical terminal).

__construct($clio)

Parameters
NameTypeDescription
$html Clio HTML/Clio object

start


Start a list (either ordered or unordered) for the first level of nesting. It will display introductory text if specified, for the first level of nesting only.

All subsequent calls to start will increase the nesting and the margin accordingly. Use end() to end the current level of nesting. There must be one end for each start called to properly close out the list.

start($text = null)

Parameters
NameTypeDescription
$text string optional text to start off the list

li


Display a list item (either ordered or unordered). This text can contain Markup strings to trigger styles within the item.

li($text)

Parameters
NameTypeDescription
$text string the text of the list item

end


End the current ordered or unordered list at the current nesting. There must be one end for every start to close out the list.

end()

UnorderedList Class

This class inherits all of the BulletedList abstract base class.

setBullet (Unordered list only)


Set the bullet string for unordered lists.

setBullet($str)

Parameters
$str string bullet string

OrderedList Class

This class inherits all of the BulletedList abstract base class and has no new methods.