本文整理汇总了PHP中Fields::editor方法的典型用法代码示例。如果您正苦于以下问题:PHP Fields::editor方法的具体用法?PHP Fields::editor怎么用?PHP Fields::editor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fields
的用法示例。
在下文中一共展示了Fields::editor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<div class="l-row">
<?php
echo $form->textFieldControlGroup($model, 'emails', array('rows' => 6, 'cols' => 50));
?>
<p class = "l-hint">The separator between emails - comma (,)</p>
</div>
<div class="l-row">
<?php
echo $form->textFieldControlGroup($model, 'theme', array('size' => 60, 'maxlength' => 255));
?>
</div>
<div class="l-row">
<?php
echo Fields::editor($model, $form, 'message');
?>
<p class = "l-hint">You can use the following templates:</p>
<ul class = "l-hint">
<li>{DATE} - The current date (dd.mm.yyyy)</li>
<li>{NAME} - Contact name (your login)</li>
</ul>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'files');
?>
<?php
$this->widget('CMultiFileUpload', array('model' => $model, 'attribute' => 'files', 'accept' => 'jpg,jpeg,gif,png,doc,docx,pdf,txt', 'denied' => 'Only: jpg,jpeg,gif,png,doc,docx,pdf,txt', 'max' => 4, 'remove' => '[x]', 'duplicate' => 'You have to attach a file with the same name', 'options' => array('afterFileSelect' => 'function(e ,v ,m){
var fileSize = e.files[0].size;
示例2: getField
protected function getField($type, $model, $form, $attribute = 'value')
{
switch ($type) {
case 'input':
return $form->textFieldControlGroup($model, $attribute);
case 'textarea':
return $form->textAreaControlGroup($model, $attribute);
case 'editor':
return Fields::editor($model, $form, $attribute);
default:
return $form->textFieldControlGroup($model, $attribute);
}
}