本文整理汇总了PHP中Chtml::endForm方法的典型用法代码示例。如果您正苦于以下问题:PHP Chtml::endForm方法的具体用法?PHP Chtml::endForm怎么用?PHP Chtml::endForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chtml
的用法示例。
在下文中一共展示了Chtml::endForm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
}
?>
<hr>
<?php
echo CHtml::submitButton(Yii::t('SpaceModule.views_admin_members', "Save"), array('class' => 'btn btn-primary'));
?>
<?php
echo \humhub\widgets\DataSaved::widget();
?>
<?php
echo Chtml::endForm();
?>
</div>
</div>
<?php
if (count($space->applicants) != 0) {
?>
<div class="panel panel-danger">
<div class="panel-heading">
<?php
echo Yii::t('SpaceModule.views_admin_members', '<strong>Outstanding</strong> user requests');
?>
</div>
<div class="panel-body">
示例2: run
public function run()
{
//create items for JUISortable
$widgetColumns = $this->getWidgetColumns();
$this->items = array();
foreach ($widgetColumns as $key => $column) {
$this->items[$key] = '<label><input type="checkbox" name="' . $this->getRequestParam() . '[]" value="' . $key . '" ' . (isset($column['visible']) ? 'checked' : '') . '> ' . CHtml::encode($column['header']) . '</label>';
}
$formId = $this->gridId . '-ecolumns';
echo CHtml::beginForm('', 'POST', array('id' => $formId));
echo CHtml::hiddenField($this->getRequestSubmit(), 1);
parent::run();
//submit button
echo '<div>';
if (!empty($this->buttonApply)) {
echo $this->buttonApply;
}
if (!empty($this->buttonCancel)) {
echo $this->buttonCancel;
}
if (!empty($this->buttonReset)) {
echo $this->buttonReset;
}
echo '</div>';
//submit handler
Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $formId, "\r\n jQuery('#{$formId}').on('submit', function(){\r\n jQuery('#{$this->gridId}').yiiGridView('update', {\r\n data: jQuery(this).serializeArray(),\r\n type: 'post'\r\n });\r\n return false;\r\n });\r\n ");
if (!empty($this->buttonReset)) {
$defaultOrder = array();
foreach ($this->columns as $key => $column) {
$defaultOrder[] = array('key' => $key, 'visible' => $this->isVisible($column));
}
Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $formId . '-reset', "\r\n jQuery('#{$formId} .reset').on('click', function(){\r\n var ul = jQuery('#{$formId} ul'),\r\n defaultOrder = " . CJSON::encode($defaultOrder) . ",\r\n buffer = jQuery('<ul>').append(ul.children().detach()),\r\n el;\r\n \r\n for(var i=0; i<defaultOrder.length; i++) {\r\n el = buffer.children('#'+defaultOrder[i].key);\r\n el.find('input').attr('checked', defaultOrder[i].visible);\r\n ul.append(el);\r\n }\r\n\r\n ul.sortable('refresh');\r\n });\r\n ");
}
echo Chtml::endForm();
}