kernel/lib/Form.php
public function add($sName, $mType, $sLabel = null, $mValue = null, $mOptions = null)
    {
        if ($mType instanceof Container) {

            $this->_aElement[$sName] = $mType;
        } else if ($mType === 'text' || $mType === 'submit' || $mType === 'password' || $mType === 'file' || $mType === 'tel'
            || $mType === 'url' || $mType === 'email' || $mType === 'search' || $mType === 'date' || $mType === 'time'
            || $mType === 'datetime' || $mType === 'month' || $mType === 'week' || $mType === 'number' || $mType === 'range'
            || $mType === 'color' || $mType === 'hidden') {

            $this->_aElement[$sName] = new Input($sName, $mType, $sLabel, $mValue);
        } elseif ($mType === 'textarea') {

            $this->_aElement[$sName] = new Textarea($sName, $sLabel, $mValue);
        } else  if ($mType === 'select') {

            $this->_aElement[$sName] = new Select($sName, $mOptions, $sLabel, $mValue);
        } else  if ($mType === 'label') {

            $this->_aElement[$sName] = new Label($sName);
        } else  if ($mType === 'list_checkbox') {

            $i = 0;

            $this->_aElement[$sName.'_'.$i++] = new Label($sLabel);

            foreach ($mValue as $mKey => $sValue) {

                $this->_aElement[$sName.'_'.$i++] = new Checkbox($sName, $sValue, $mKey, $mOptions);
            }
        } else  if ($mType === 'checkbox') {

            $this->_aElement[$sName] = new Checkbox($sName, $sLabel, $mValue, $mOptions);
        } else  if ($mType === 'radio') {

            $this->_aElement[$sName.rand(100000, 999999)] = new Radio($sName, $sLabel, $mValue, $mOptions);
        }

        return $this;
    }
public function add($sName, $mType, $sLabel = null, $mValue = null, $mOptions = null)
    {
        if ($mType instanceof Container) {

            $this->_aElement[$sName] = $mType;
        } else if ($mType === 'text' || $mType === 'submit' || $mType === 'password' || $mType === 'file' || $mType === 'tel'
            || $mType === 'url' || $mType === 'email' || $mType === 'search' || $mType === 'date' || $mType === 'time'
            || $mType === 'datetime' || $mType === 'month' || $mType === 'week' || $mType === 'number' || $mType === 'range'
            || $mType === 'color' || $mType === 'hidden') {

            $this->_aElement[$sName] = new Input($sName, $mType, $sLabel, $mValue);
        } elseif ($mType === 'textarea') {

            $this->_aElement[$sName] = new Textarea($sName, $sLabel, $mValue);
        } else  if ($mType === 'select') {

            $this->_aElement[$sName] = new Select($sName, $mOptions, $sLabel, $mValue);
        } else  if ($mType === 'label') {

            $this->_aElement[$sName] = new Label($sName);
        } else  if ($mType === 'list_checkbox') {

            $i = 0;

            $this->_aElement[$sName.'_'.$i++] = new Label($sLabel);

            foreach ($mValue as $mKey => $sValue) {

                $this->_aElement[$sName.'_'.$i++] = new Checkbox($sName, $sValue, $mKey, $mOptions);
            }
        } else  if ($mType === 'checkbox') {

            $this->_aElement[$sName] = new Checkbox($sName, $sLabel, $mValue, $mOptions);
        } else  if ($mType === 'radio') {

            $this->_aElement[$sName.rand(100000, 999999)] = new Radio($sName, $sLabel, $mValue, $mOptions);
        }

        return $this;
    }
add an element in the form

@access public
@param  string $sName name
@param  string|\Venus\lib\Form $mType type of field
@param  string $sLabel label of field
@param  mixed $mValue value of field
@parma  mixed $mOptions options (for select)
@return \Venus\lib\Form