Ejemplo n.º 1
0
 /**
  * @param DOMNode        $node
  * @param ReferenceTable $table
  *
  * @return mixed|void
  */
 public function parse(DOMNode $node, ReferenceTable &$table)
 {
     $this->sheet->getCell($table->getCoordinate())->getHyperlink()->setUrl($node->getAttribute('href'));
     // Underline and make it blue
     $this->sheet->cell($table->getCoordinate(), function ($cell) {
         $cell->font()->underline()->color('0000ff');
     });
     // Add whitespace
     $table->appendContent(' ');
     $this->next($node, $table);
 }
Ejemplo n.º 2
0
 /**
  * @param DOMAttr        $attribute
  * @param ReferenceTable $table
  *
  * @return mixed
  */
 public function parse(DOMAttr $attribute, ReferenceTable &$table)
 {
     // Get all inline styles separately
     $styles = explode($this->styleSeparator, $attribute->value);
     foreach ($styles as $style) {
         $style = explode($this->valueSeperator, $style);
         $name = trim(reset($style));
         $value = trim(end($style));
         // When the parser exists, parse the style
         if ($name && $value && ($parser = StyleParserFactory::create($name, $this->sheet))) {
             $cell = $this->sheet->cell($table->getCoordinate());
             $parser->parse($cell, $value, $table);
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * @param DOMAttr        $attribute
  * @param ReferenceTable $table
  *
  * @return mixed
  */
 public function parse(DOMAttr $attribute, ReferenceTable &$table)
 {
     $this->sheet->cell($table->getCoordinate(), function (Cell $cell) use($attribute) {
         $cell->align($attribute->value);
     });
 }