Example #1
0
 /**
  * Add content to the ItemList
  *
  * @param Content   $content        Content object
  * @param ItemList  $children       Children
  * @param array     $itemAttributes Attributes for the item (li)
  * @param string    $itemElement    Element for the item (li is default)
  * @param string    $beforeContent  String to add before the content
  * @param string    $afterContent   String to add after the content
  */
 public function addContent($content, $children = null, $itemAttributes = array(), $itemElement = null, $beforeContent = null, $afterContent = null)
 {
     $item = new Item($this, $content, $children, $itemElement, $beforeContent, $afterContent);
     $item->setAttributes($itemAttributes);
     // Set Item as parent of its children
     if (!is_null($children)) {
         $children->setParent($item);
     }
     $this->setChild($item);
     return $item;
 }