コード例 #1
0
 /**
  * Generate the label.
  *
  * @return string
  */
 public function generate()
 {
     if ($this->isVisible()) {
         return parent::generate();
     }
     return '';
 }
コード例 #2
0
ファイル: Element.php プロジェクト: netzmacht/html
 /**
  * @param Node $parent
  * @param string $position
  * @return $this
  */
 public function appendTo(Node $parent, $position = Node::POSITION_LAST)
 {
     $parent->addChild($this, $position);
     return $this;
 }
コード例 #3
0
 /**
  * Construct.
  *
  * @param string $tag        Element tag.
  * @param array  $attributes Attributes.
  */
 public function __construct($tag, $attributes = array())
 {
     parent::__construct($tag, $attributes);
     $this->childAttributes = new Attributes();
 }
コード例 #4
0
ファイル: NodeSpec.php プロジェクト: netzmacht/html
 function it_casts_to_string_contains_content(Node $a)
 {
     $content = '<a href="#test">Test</a>';
     $a->generate()->willReturn($content);
     $a->__toString()->willReturn($content);
     $this->addChild($a);
     $this->generate()->shouldReturn('<p class="example" id="test">' . $content . '</p>' . PHP_EOL);
 }
コード例 #5
0
ファイル: StandaloneSpec.php プロジェクト: netzmacht/html
 function it_is_appendable_to_position(Node $parent)
 {
     $parent->addChild($this, Node::POSITION_FIRST)->shouldBeCalled();
     $this->appendTo($parent, Node::POSITION_FIRST)->shouldReturn($this);
 }