当前位置: 首页>>代码示例>>PHP>>正文


PHP CFormModel::groups方法代码示例

本文整理汇总了PHP中CFormModel::groups方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormModel::groups方法的具体用法?PHP CFormModel::groups怎么用?PHP CFormModel::groups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFormModel的用法示例。


在下文中一共展示了CFormModel::groups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderMain

 /**
  * Renders the main body content
  * @param  CActiveForm $form  The Form we're working with
  */
 private function renderMain($form)
 {
     // #main .content
     echo CHtml::openTag('div', array('id' => 'main', 'class' => 'nano'));
     echo CHtml::openTag('div', array('class' => 'nano-content'));
     echo CHtml::openTag('fieldset');
     // If we want a custom form view, render that view instead of the default behavior
     if ($this->model->form !== NULL) {
         $this->controller->renderPartial($this->model->form, array('model' => $this->model, 'properties' => $this->properties, 'form' => $form));
     } else {
         if (count($this->properties) == 0) {
             echo CHtml::tag('legend', array(), Yii::t('Dashboard.main', 'Change Theme Settings'));
             echo CHtml::tag('div', array('class' => 'alert alert-info'), Yii::t('Dashboard.main', 'There are no settings for this section.'));
         } else {
             $groups = $this->model->groups();
             if (!empty($groups)) {
                 foreach ($groups as $name => $attributes) {
                     echo CHtml::tag('legend', array(), $name);
                     echo CHtml::tag('div', array('class' => 'clearfix'), NULL);
                     foreach ($attributes as $property) {
                         $p = new StdClass();
                         $p->name = $property;
                         $this->renderProperties($form, $p);
                     }
                 }
             } else {
                 echo CHtml::tag('legend', array(), CiiInflector::titleize(get_class($this->model)));
                 foreach ($this->properties as $property) {
                     $this->renderProperties($form, $property);
                 }
             }
         }
     }
     echo CHtml::closeTag('div');
     echo CHtml::closeTag('div');
     echo CHtml::closeTag('div');
 }
开发者ID:charlesportwoodii,项目名称:cii,代码行数:41,代码来源:CiiSettingsForm.php

示例2: renderMain

    /**
     * Renders the main body content
     * @param  CActiveForm $Form  The Form we're working with
     */
    private function renderMain($form)
    {
        // #main .content
        echo CHtml::openTag('div', array('id' => 'main', 'class' => 'nano'));
        echo CHtml::openTag('div', array('class' => 'content'));
        echo CHtml::openTag('fieldset');
        // If we want a custom form view, render that view instead of the default behavior
        if ($this->model->form !== NULL) {
            $this->controller->renderPartial($this->model->form, array('model' => $this->model, 'properties' => $this->properties, 'form' => $form));
        } else {
            if (count($this->properties) == 0 && $this->model->preContentView == NULL) {
                echo CHtml::tag('legend', array(), Yii::t('Dashboard.main', 'Change Theme Settings'));
                echo CHtml::tag('div', array('class' => 'alert alert-info'), Yii::t('Dashboard.main', 'There are no settings for this section.'));
            } else {
                $groups = $this->model->groups();
                if (!empty($groups)) {
                    foreach ($groups as $name => $attributes) {
                        echo CHtml::tag('legend', array(), $name);
                        echo CHtml::tag('div', array('class' => 'clearfix'), NULL);
                        foreach ($attributes as $property) {
                            $p = new StdClass();
                            $p->name = $property;
                            $this->renderProperties($form, $p);
                        }
                    }
                } else {
                    echo CHtml::tag('legend', array(), Cii::titleize(get_class($this->model)));
                    foreach ($this->properties as $property) {
                        $this->renderProperties($form, $property);
                    }
                }
                echo CHtml::tag('button', array('id' => 'header-button', 'escape' => false, 'class' => 'pure-button pure-button-primary pure-button-small pull-right'), CHtml::tag('i', array('class' => 'icon-spinner icon-spin icon-spinner-form2', 'style' => 'display: none'), NULL) . $this->header['save-text']);
            }
        }
        echo CHtml::closeTag('div');
        echo CHtml::closeTag('div');
        echo CHtml::closeTag('div');
        Yii::app()->getClientScript()->registerScript('change', '
			$("input:not([no-field-change=\'true\']").on("input onpropertychange change", function() {

				try {
					$(".icon-spinner-form2").fadeIn();
					clearTimeout(timeout);
				} catch (e) {}
				
				timeout = setTimeout(function() {

					var values = $("form").serializeArray();

				    $("form input[type=checkbox]:not(:checked)").each(function() {
				    	values.push({ "name" : this.name, "value" : 0 })
				    });

					$.post($("form").attr("action"), values, function(data, textStatus) {
						var d = $("#yw2", $.parseHTML(data));

						$("#yw2").html($(d).html());						
						$(".alert").not(".alert-secondary").fadeIn(1000);
						$(".icon-spinner-form2").fadeOut();
						setTimeout(function() { $(".alert").not(".alert-secondary").fadeOut(1000); }, 5000);
					});

				}, 1000);

			});
		');
    }
开发者ID:fandikurnia,项目名称:CiiMS,代码行数:71,代码来源:CiiSettingsForm.php


注:本文中的CFormModel::groups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。