コード例 #1
0
ファイル: HTMLTagTest.php プロジェクト: pscheit/psc-cms
 /**
  * @dataProvider provideTestToStringConsSetters
  */
 public function testToStringConsSetters($tagname, $content, $attributes, $html)
 {
     $tag1 = new HTMLTag($tagname, $content, $attributes);
     $this->assertEquals((string) $tag1, $html);
     $this->assertEquals($tag1->html(), $html);
     /* wir versuchen noch andere methoden das tag zu erstellen */
     $tag2 = new HTMLTag($tagname);
     $tag2->setContent($content);
     $tag2->setAttributes($attributes);
     $this->assertEquals((string) $tag2, $html);
     $this->assertEquals($tag2->html(), $html);
     $tag3 = fHTML::tag($tagname, $content, $attributes);
     $this->assertEquals((string) $tag3, $html);
     $this->assertEquals($tag3->html(), $html);
     $tag4 = fHTML::tag($tagname)->setContent($content)->setAttributes($attributes);
     $this->assertEquals((string) $tag4, $html);
     $this->assertEquals($tag4->html(), $html);
     $tag5 = clone $tag4;
     if (is_array($attributes)) {
         foreach ($attributes as $key => $attr) {
             $tag5->setAttribute($key, $attr);
         }
     }
     $this->assertEquals((string) $tag4, (string) $tag5);
     $this->assertEquals($tag4->html(), $html);
 }
コード例 #2
0
ファイル: Form.php プロジェクト: pscheit/psc-cms
 protected function doInit()
 {
     $this->html = HTML::tag('form', $this->content, array('method' => $this->method, 'action' => $this->action, 'class' => '\\Psc\\form'));
     $this->html->guid($this->formId);
     foreach ($this->httpHeaders as $name => $value) {
         // fHTML ist mehr basic und macht nur hidden, ohne ids ohne schnickschnack
         $this->html->content->{$name} = FormHTML::hidden($name, $value)->addClass('psc-cms-ui-http-header');
         // \Psc geht nicht weil kein UI
     }
     foreach ($this->postData as $key => $value) {
         $this->html->content->{$key} = FormHTML::hidden($key, $value);
     }
 }
コード例 #3
0
ファイル: Base.php プロジェクト: pscheit/psc-cms
 protected function convertHTMLName($name)
 {
     return \Psc\Form\HTML::getName($name);
 }