當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CActiveForm::hiddenField方法代碼示例

本文整理匯總了PHP中CActiveForm::hiddenField方法的典型用法代碼示例。如果您正苦於以下問題:PHP CActiveForm::hiddenField方法的具體用法?PHP CActiveForm::hiddenField怎麽用?PHP CActiveForm::hiddenField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CActiveForm的用法示例。


在下文中一共展示了CActiveForm::hiddenField方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: activeJuiAutoComplete

 public function activeJuiAutoComplete(CActiveForm $form, CModel $model, $attribute, $acRoute, $acValue, array $acOptions = array(), array $htmlOptions = array(), $loader = '/images/loader.gif')
 {
     $defaultAcOptions = array('minLength' => '3', 'select' => "js:{$attribute}_fillHidden", 'focus' => "js:{$attribute}_itemFocus", 'search' => "js:{$attribute}_initSearch", 'open' => "js:{$attribute}_finishedSearch");
     $acName = "{$attribute}_autocomplete";
     $_POST[$acName] = $acValue;
     echo $form->hiddenField($model, $attribute);
     $this->owner->widget('zii.widgets.jui.CJuiAutoComplete', array('name' => $acName, 'value' => $acValue, 'sourceUrl' => $acRoute, 'options' => array_merge($defaultAcOptions, $acOptions), 'htmlOptions' => $htmlOptions));
     Yii::app()->clientScript->registerScript('jui_extras', "\n\t\t\tfunction {$attribute}_initSearch(e, ui) {\n\t\t\t\t\$(e.target).after('<img src=\"{$loader}\" class=\"loader\" alt=\"...\" />')\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tfunction {$attribute}_finishedSearch(e, ui) {\n\t\t\t\t\$(e.target).siblings('img').remove()\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tfunction {$attribute}_fillHidden(e, ui) {\n\t\t\t\t\$('#" . get_class($model) . "_{$attribute}').val(ui.item.value)\n\t\t\t\t\$(e.target).val(ui.item.label)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tfunction {$attribute}_itemFocus(e, ui) {\n\t\t\t\t\$(e.target).val(ui.item.label)\n\t\t\t\treturn false\n\t\t\t}\n\t\t");
 }
開發者ID:nurirahmat,項目名稱:Yii-Extensions,代碼行數:9,代碼來源:HtmlEx.php

示例2: hiddenField

 /**
  * @inheritDoc
  */
 public function hiddenField($model, $attribute, $htmlOptions = array())
 {
     if (!$this->qualifyNames && !isset($htmlOptions['name'])) {
         $htmlOptions['name'] = $attribute;
     }
     if (!isset($htmlOptions['itemprop'])) {
         $htmlOptions['itemprop'] = $this->getItemPropName($attribute);
     }
     return parent::hiddenField($model, $attribute, $htmlOptions);
 }
開發者ID:codemix,項目名稱:restyii,代碼行數:13,代碼來源:ActiveForm.php

示例3: getActionElements

 public function getActionElements($controller, $action)
 {
     $form = new CActiveForm();
     $p = Yii::app()->createController($controller);
     if ($p && isset($p[0])) {
         $contObj = $p[0];
     } else {
         $contObj = array();
     }
     if ($contObj && ($actonArr = $contObj->actions())) {
         if (isset($actonArr[$action]) && $actonArr[$action]['class'] == 'CViewAction') {
             $path = $contObj->viewPath . '/pages';
             $files = array();
             if (is_dir($path)) {
                 foreach (scandir($path) as $file) {
                     if (strpos($file, '.php')) {
                         $name = str_replace('.php', '', $file);
                         $files[$name] = $name;
                     }
                 }
             }
             if ($files) {
                 return $form->dropDownList($this, 'element', $files, array()) . $form->hiddenField($this, 'elementmodel', array('value' => 'CViewAction'));
             }
         }
     }
     $actions = array();
     $controller = $_SERVER['DOCUMENT_ROOT'] . '/protected/controllers/' . $controller . 'Controller.php';
     $file = file_get_contents($controller);
     preg_match('!.*action' . $action . '(.*)!im', $file, $matches);
     if (isset($matches[1])) {
         preg_match('!\\/\\*(.*)\\*\\/!ism', $matches[1], $matches);
     }
     if (isset($matches[1])) {
         parse_str($matches[1]);
         //
         $criteria = new CDbCriteria();
         if ($condition) {
             $criteria->condition = $condition;
         }
         if ($order) {
             $criteria->order = $order;
         }
         $returmnodels = new $model();
         $returmnodels = $returmnodels->model()->findAll($criteria);
         $this->elementmodel = $model;
         if (isset($selectitem3)) {
             return $form->dropDownList($this, 'element', CHtml::listData($returmnodels, $selectitem1, $selectitem2, $selectitem3), array('prompt' => 'Выбирите...')) . $form->hiddenField($this, 'elementmodel');
         } else {
             return $form->dropDownList($this, 'element', CHtml::listData($returmnodels, $selectitem1, $selectitem2), array('prompt' => 'Выбирите...')) . $form->hiddenField($this, 'elementmodel');
         }
     } else {
         return '';
     }
 }
開發者ID:ASDAFF,項目名稱:RosYama.2,代碼行數:55,代碼來源:MainMenu.php

示例4: hiddenField

 /**
  * Renders a hidden field for a model attribute.
  * @param CModel $parentModel the parent data model
  * @param string $attributedPath the attribute or path to related model attribute
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated input field
  */
 public function hiddenField($parentModel, $attributedPath, $htmlOptions = array())
 {
     list($model, $attribute, $htmlOptions) = self::resolveArgs($parentModel, $attributedPath, $htmlOptions);
     return parent::hiddenField($model, $attribute, $htmlOptions);
 }
開發者ID:nov072008,項目名稱:yiitesting,代碼行數:12,代碼來源:WForm.php

示例5: array

                <div class="vd"><?php 
    echo $model->price;
    ?>
 VD</div>
                <div class="buy">Купить <?php 
    echo $model->type == 0 ? "скидку" : "сертификат";
    ?>
</div>
        </div>
    <div class="hidden-form">
        <div class="field">
            <?php 
    if (!$model->isNewRecord) {
        ?>
            <?php 
        echo $form->hiddenField($model, "[{$i}]id");
        ?>
            <?php 
    }
    ?>
            <?php 
    echo $form->hiddenField($model, "[{$i}]type");
    ?>
            <?php 
    echo $form->labelEx($model, "[{$i}]text");
    ?>
            <?php 
    echo $form->textArea($model, "[{$i}]text", array("rows" => 6, "cols" => 50, 'class' => 'required'));
    ?>
            <?php 
    echo $form->error($model, "[{$i}]text");
開發者ID:BGCX067,項目名稱:facecom-svn-to-git,代碼行數:31,代碼來源:_form_coupon.php


注:本文中的CActiveForm::hiddenField方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。