Orion PHP  0.11.12
The PHP5.3 framework
id.php
Go to the documentation of this file.
00001 <?php
00002 namespace Orion\Core\Model;
00003 
00004 
00005 class Id extends Field
00006 {
00007     /**
00008      * ID model field
00009      * @param string $bind
00010      * @param string $label
00011      * @param boolean $primary
00012      */
00013     public function __construct($bind='id', $label='Id', $primary=true)
00014     {
00015         $this->type = 'id';
00016         $this->bind = $bind;
00017         $this->label = $label;
00018         $this->primary = $primary;
00019     }
00020 
00021     public function toHtml($XHTML=true)
00022     {
00023         if($XHTML)
00024             $tag = ' /';
00025         else
00026             $tag = '';
00027         
00028         return '<input name="'.$this->bind.'" type="hidden" value="'.$this->value.'"'.$tag.'>';
00029     }
00030 }
00031 
00032 ?>