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


PHP CForm::getElements方法代码示例

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


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

示例1: run

 public function run()
 {
     $htmlOptions = array_merge(array('class' => 'form wide'), $this->htmlOptions);
     $form = new CForm($this->form, $this->form['model']);
     echo CHtml::openTag('div', $htmlOptions);
     echo $form->renderBegin();
     foreach ($form->getElements() as $element) {
         echo CHtml::openTag('div', array('class' => 'row'));
         echo $element->render();
         echo '</div>';
     }
     echo '<div style="display:block; height:30px; margin-top:10px;">';
     echo $form->renderButtons();
     echo '</div>';
     echo $form->getActiveFormWidget()->errorSummary($this->form['model']) . "\n";
     echo $form->renderEnd();
     echo '</div>';
 }
开发者ID:balrok,项目名称:aiajaya,代码行数:18,代码来源:FormRenderer.php

示例2: getElements

    public function getElements()
    {
        $elements = parent::getElements();
        foreach ($elements as $element)
        {
            if (isset($element->attributes['prompt']))
            {
                $element->attributes['prompt'] = t($element->attributes['prompt']);
            }
        }

        return $elements;
    }
开发者ID:nizsheanez,项目名称:blog.ru,代码行数:13,代码来源:Form.php

示例3: CForm

 */
//print_r($elements); die;
if (isset($modelArray[0]) && isset($elements['elements'][0])) {
    $formHead = new CForm(array_merge($elements['elements'][0], ContextController::getDefaultElements()), $modelArray[0]);
    echo $formHead->renderBegin();
}
echo CHtml::tag('div', ['class' => 'form'], false, false);
echo CHtml::tag('table', ['class' => 'tabular-container'], false, false);
echo CHtml::tag('thead', ['class' => 'tabular-header'], false, false);
echo CHtml::tag('tr', [], $tableHeader);
echo CHtml::closeTag('thead');
echo CHtml::tag('tbody', ['class' => 'tabular-input-container'], false, false);
foreach ($modelArray as $modelIndex => $model) {
    echo CHtml::tag('tr', ['class' => 'tabular-input'], false, false);
    $form = new CForm($elements['elements'][$modelIndex], $model);
    foreach ($form->getElements() as $element) {
        $element->name = "[{$modelIndex}]{$element->name}";
        echo CHtml::tag('td', [], $element->renderInput());
    }
    echo CHtml::closeTag('tr');
    //$form[$modelIndex] = $model;
}
echo CHtml::closeTag('tbody');
echo CHtml::closeTag('table');
echo CHtml::submitButton('Update');
echo CHtml::closeTag('div');
echo $formHead->renderEnd();
?>
<script>
	$(function() {
		$('select')
开发者ID:schrapps,项目名称:risksur,代码行数:31,代码来源:editMultipleComponents.php

示例4: getForm

	/**
	* Get the form
	* @param boolean Whether the item can be renamed. If not the name element is
	* made read only.
	* @return CForm Form for the model
	*/
	public function getForm($rename=true) {
		$form = new CForm($this->_formConfig(), $this);

		$elements = $form->getElements();
		if (!$rename)
			$elements['name']->attributes = array('readonly'=>'readonly');

		if ($this->scenario==='update')
			$elements->add('oldName', array(
				'type'=>'hidden',
				'value'=>$this->name,
				'visible'=>true
			));

		return $form;
	}
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:22,代码来源:AuthItem.php


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