Beispiel #1
0
 /**
  * Visit a hidden input node.
  *
  * @param T_Form_Hidden $node
  */
 function visitFormHidden(T_Form_Hidden $node)
 {
     $xhtml = $this->indent . '<div class="hidden">' . EOL;
     // render value
     $attributes = $node->getAllAttributes();
     $attributes += array('type' => 'hidden', 'name' => $node->getFieldname(), 'value' => $node->getFieldValue());
     $xhtml .= $this->indent . '<input ';
     foreach ($attributes as $key => $value) {
         $xhtml .= $key . '="' . $this->escape($value) . '"' . EOL . $this->indent . '       ';
     }
     $xhtml = rtrim($xhtml) . ' /> ' . EOL;
     // render checksum
     $attributes = array('type' => 'hidden', 'name' => $node->getChecksumFieldname(), 'value' => $node->getChecksumFieldValue());
     $xhtml .= $this->indent . '<input ';
     foreach ($attributes as $key => $value) {
         $xhtml .= $key . '="' . $this->escape($value) . '"' . EOL . $this->indent . '       ';
     }
     $xhtml = rtrim($xhtml) . ' /> ' . EOL;
     $xhtml .= $this->indent . '</div>' . EOL;
     $this->addXhtml($xhtml);
 }
Beispiel #2
0
 function testGetAllAttributesReturnsEmptyArrayByDefault()
 {
     $input = new T_Form_Hidden('alias', 'value');
     $this->assertSame($input->getAllAttributes(), array());
 }