Hoa central
Value.php
Go to the documentation of this file.
1 <?php
2 
38 
39 use Hoa\Stream;
40 use Hoa\Xml;
41 use Hoa\Xyl;
42 
51 class Value
52  extends Xyl\Element\Concrete
54 {
60  protected static $_attributes = [
61  'link' => self::ATTRIBUTE_TYPE_LINK,
62  'formatter' => self::ATTRIBUTE_TYPE_CUSTOM
63  ];
64 
65 
66 
73  public function paint(Stream\IStream\Out $out)
74  {
75  $value = $this->computeValue();
76 
77  if (true === $this->abstract->attributeExists('formatter')) {
78  $value = $this->formatValue(empty($value) ? null : $value);
79  }
80 
81  if (true === $this->abstract->attributeExists('link')) {
82  $out->writeAll($this->computeAttributeValue(
83  $this->abstract->readAttribute('link'),
84  parent::ATTRIBUTE_TYPE_LINK
85  ));
86 
87  return;
88  }
89 
90  $out->writeAll($value);
91 
92  return;
93  }
94 }
static paint(Stream\IStream\Out $out)
Definition: Value.php:73
formatValue($value, $name=null)
Definition: Concrete.php:563
computeValue(Stream\IStream\Out $out=null)
Definition: Concrete.php:410
computeAttributeValue($value, $type=self::ATTRIBUTE_TYPE_UNKNOWN, $name=null)
Definition: Concrete.php:488