1. Christoffer Niska
  2. yii-bootstrap
  3. Issues
Issue #271 new

Add hidden field

Anonymous created an issue

Add the following lines into the respect files.

TbInputVertical.php

         /**
         * Renders a hidden field.
         * @return string the rendered content
         */
        protected function hiddenField() {
            //echo $this->getLabel();
            //echo $this->getPrepend();
            echo $this->form->hiddenField($this->model, $this->attribute, $this->htmlOptions);
            //echo $this->getAppend();
            //echo $this->getError().$this->getHint();
        }

TbInput.php

const TYPE_HIDDEN = 'hidden';

Add following lines in run():

                case self::TYPE_HIDDEN:
                    $this->hiddenField();
                    break;
        /**
         * Renders an hidden field.
         * @return string the rendered content
         * @abstract
         */
        abstract protected function hiddenField();

TbActiveForm.php

         /**
         * Renders an hidden text field row.
         * @param CModel $model the data model
         * @param string $attribute the attribute
         * @param array $htmlOptions additional HTML attributes
         * @return string the generated row
         * @since 0.9.5
         */
        public function hiddenRow($model, $attribute, $htmlOptions = array()) {
            return $this->inputRow(TbInput::TYPE_HIDDEN, $model, $attribute, null, $htmlOptions);
        }

Comments (0)

  1. Log in to comment