Пример #1
0
 /**
  * @param Block $block
  * @param $len
  */
 public function __construct(Block $block, $len)
 {
     $this->parsed = $block->parsed;
     $this->block = $block;
     $this->count = min(max($len, 0), 6);
     $this->modifier = $block->modifier;
     $this->parser = $this->parsed->parser;
     $this->parser->addType($this);
 }
Пример #2
0
 /**
  * @param Block $block
  */
 public function __construct(Block $block)
 {
     $this->parsed = $block->parsed;
     $this->block = $block;
     $termSet = false;
     $term = '';
     $description = '';
     foreach ($this->parsed->children as $child) {
         if ($child->text == ':' && $termSet == false) {
             $termSet = true;
         } else {
             if ($termSet == false) {
                 $term .= $child->text;
             } else {
                 $description .= $child->text;
             }
         }
     }
     $this->items[] = new DescriptionListItem($term, $description);
     $this->parser = $this->parsed->parser;
     $this->parser->addType($this);
 }