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