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


PHP TbHtml::activeHiddenField方法代碼示例

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


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

示例1: run

 /**
  * Runs the widget.
  */
 public function run()
 {
     list($name, $id) = $this->resolveNameID();
     $id = $this->resolveId($id);
     echo TbHtml::openTag('div', array('class' => 'select2'));
     if ($this->hasModel()) {
         if ($this->asDropDownList) {
             echo TbHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);
         } else {
             echo TbHtml::activeHiddenField($this->model, $this->attribute, $this->htmlOptions);
         }
     } else {
         if ($this->asDropDownList) {
             echo TbHtml::dropDownList($name, $this->value, $this->data, $this->htmlOptions);
         } else {
             echo TbHtml::hiddenField($name, $this->value, $this->htmlOptions);
         }
     }
     echo '</div>';
     if ($this->assetPath !== false) {
         $this->publishAssets($this->assetPath);
         $this->registerCssFile('/select2.css');
         if ($this->registerJs) {
             $this->registerScriptFile('/select2.js', CClientScript::POS_END);
         }
     }
     if ($this->bindPlugin) {
         $options = !empty($this->pluginOptions) ? CJavaScript::encode($this->pluginOptions) : '';
         $this->getClientScript()->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').select2({$options});");
     }
 }
開發者ID:juanprua,項目名稱:yiistrap-widgets,代碼行數:34,代碼來源:TbSelect2.php

示例2: renderField

 /**
  * Renders the select2 field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     if ($this->hasModel()) {
         echo $this->asDropDownList ? TbHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions) : TbHtml::activeHiddenField($this->model, $this->attribute);
     } else {
         echo $this->asDropDownList ? TbHtml::dropDownList($this->name, $this->value, $this->data, $this->htmlOptions) : TbHtml::hiddenField($this->name, $this->value);
     }
 }
開發者ID:branJakJak,項目名稱:goawtodayaldiskon,代碼行數:14,代碼來源:WhSelect2.php

示例3: renderImages

    public function renderImages()
    {
        $html = <<<EOF
        <div id='imagesnow' style='display:none;min-height:330px;border:1px dashed slategray;overflow-x:scroll;' onload="startimagesnow">
    <ul id="sortable"></ul>
</div>
EOF;
        echo CHtml::openTag('div', array('class' => 'controls'));
        echo $html;
        echo TbHtml::button("圖片預覽", array('id' => 'Post_togglemagesnow'));
        echo TbHtml::button("上傳圖片", array('id' => 'Post_selectImage'));
        echo TbHtml::activeHiddenField($this->model, 'images');
        echo CHtml::closeTag('div');
    }
開發者ID:cooltheo,項目名稱:fircms,代碼行數:14,代碼來源:FImges.php

示例4: get_class

<?php

/* @var $this DefaultController */
Yii::import('application.modules.user.models.User');
$modelClass = get_class($news);
$this->widget('bootstrap.widgets.TbBreadcrumb', array('links' => array(Yii::t('main', ucfirst($this->module->id)) => Yii::app()->createUrl($this->module->id), Yii::t('main', ucfirst($this->action->id)))));
?>

<?php 
$this->widget('bootstrap.widgets.TbAlert', array('block' => true, 'fade' => true, 'closeText' => '×', 'alerts' => array('success' => array('block' => true, 'fade' => true, 'closeText' => '×'), 'error' => array('block' => true, 'fade' => true, 'closeText' => '×'))));
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'news-form', 'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL, 'htmlOptions' => array('enctype' => 'multipart/form-data')));
//show errors (for all models)
echo $form->errorSummary(array($news, $post, $portfolio), null, null, array('class' => 'alert-error'));
//hidden field for post_type (set by defined controller)
echo TbHtml::activeHiddenField($post, 'post_type');
?>

    <div class="control-group">
        <?php 
echo TbHtml::activeLabelEx($news, 'publication_date', array('class' => 'control-label'));
?>
        <div class="controls">
            <?php 
$this->widget('yiiwheels.widgets.datetimepicker.WhDateTimePicker', array('name' => $modelClass . '[publication_date]', 'id' => $modelClass . '_publication_date', 'value' => $news->publication_date, 'format' => 'yyyy-MM-dd hh:mm:ss', 'pluginOptions' => array()));
?>
        </div>
    </div>    

    <?php 
//echo $form->dropDownListControlGroup($news, 'user_id', CHtml::listData(User::model()->findAll(), 'user_id', 'email'), array('size'=>1));
?>
開發者ID:andreyantonov78,項目名稱:atmosphera,代碼行數:31,代碼來源:form.php


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