本文整理匯總了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);
}
}