本文整理汇总了PHP中Fields::getDisplayedModelNamesList方法的典型用法代码示例。如果您正苦于以下问题:PHP Fields::getDisplayedModelNamesList方法的具体用法?PHP Fields::getDisplayedModelNamesList怎么用?PHP Fields::getDisplayedModelNamesList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fields
的用法示例。
在下文中一共展示了Fields::getDisplayedModelNamesList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
*
* You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley,
* California 95067, USA. or at email address contact@x2engine.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* X2Engine" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by X2Engine".
*****************************************************************************************/
// default view parameters
$modelList = !isset($modelList) ? Fields::getDisplayedModelNamesList() : $modelList;
$actionModel = !isset($actionModel) ? $model : $actionModel;
Yii::app()->clientScript->registerCss('actionsFormCss', "\n #Actions_actionDescription {\n box-sizing: border-box;\n }\n");
$themeUrl = Yii::app()->theme->getBaseUrl();
$backdating = !(Yii::app()->user->checkAccess('ActionsAdmin') || Yii::app()->settings->userActionBackdating);
?>
<div class="form" id="action-form">
<?php
$form = $this->beginWidget('X2ActiveForm', array('id' => 'actions-newCreate-form', 'namespace' => isset($namespace) ? $namespace : '', 'enableAjaxValidation' => false));
echo $form->errorSummary($actionModel);
?>
<div class="row">
<b><?php
echo $form->labelEx($actionModel, 'subject');
?>
</b>
示例2: actionGetX2ModelInput
/**
* Calls renderInput for model and input type with given names and returns the result.
*/
public function actionGetX2ModelInput($modelName, $fieldName)
{
if (!isset($modelName) || !isset($fieldName)) {
throw new CHttpException(400, 'modelName or fieldName not set');
return;
}
$model = X2Model::model($modelName);
if (!$model) {
throw new CHttpException(400, 'Invalid model name');
return;
}
$field = $model->getField($fieldName);
if (!$model) {
throw new CHttpException(400, 'Invalid field name');
return;
}
$input = '';
if ($fieldName == 'associationName') {
$input .= CHtml::activeDropDownList($model, 'associationType', array_merge(array('none' => Yii::t('app', 'None'), 'calendar' => Yii::t('calendar', 'Calendar')), Fields::getDisplayedModelNamesList()), array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('/actions/actions/parseType'), 'update' => '#', 'data' => 'js:$(this).serialize()', 'success' => 'function(data){
if(data){
$("#auto_select").autocomplete("option","source",data);
$("#auto_select").val("");
$("#auto_complete").show();
}else{
$("#auto_complete").hide();
}
}')));
$input .= "<div id='auto_complete' style='display: none'>";
$input .= $this->widget('zii.widgets.jui.CJuiAutoComplete', array('name' => 'auto_select', 'value' => $model->associationName, 'source' => $model->associationType !== 'Calendar' ? $this->createUrl(X2Model::model($modelName)->autoCompleteSource) : '', 'options' => array('minLength' => '2', 'select' => 'js:function( event, ui ) {
$("#' . CHtml::activeId($model, 'associationId') . '").val(ui.item.id);
$(this).val(ui.item.value);
return false;
}')), true);
$input .= "</div>";
} else {
$input .= $model->renderInput($fieldName);
}
// force loading of scripts normally rendered in view
$input .= '<br /><br /><script id="x2-model-render-input-scripts">' . "\n";
if (isset(Yii::app()->clientScript->scripts[CClientScript::POS_READY])) {
foreach (Yii::app()->clientScript->scripts[CClientScript::POS_READY] as $id => $script) {
if (strpos($id, 'logo') === false) {
$input .= "{$script}\n";
}
}
}
$input .= "</script>";
$response = array('input' => $input, 'field' => array('type' => $field->type));
echo CJSON::encode($response);
}
示例3: array
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'criteria-form', 'enableAjaxValidation' => false));
?>
<em><?php
echo Yii::t('app', 'Fields with <span class="required">*</span> are required.');
?>
</em><br>
<div class="row">
<?php
echo $form->labelEx($model, 'modelType');
?>
<?php
echo $form->dropDownList($model, 'modelType', Fields::getDisplayedModelNamesList(), array('empty' => Yii::t('admin', 'Select a model'), 'ajax' => array('type' => 'POST', 'url' => $this->createUrl('/admin/getAttributes', array('criteria' => 1)), 'update' => '#' . CHtml::activeId($model, 'modelField'))));
?>
<?php
echo $form->error($model, 'modelType');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'modelField');
?>
<?php
echo $form->dropDownList($model, 'modelField', array(), array('empty' => Yii::t('admin', 'Select a model first')));
?>
<?php
echo $form->error($model, 'modelField');