作者:grig
项目:m22-cm
public function run()
{
$settings = ArrayHelper::merge($this->getDefaultSettings(), $this->settings);
$content = '';
foreach (Yii::$app->lang->getLanguages() as $langKey => $langTitle) {
$htmlOptions = ['class' => ''];
$htmlOptions['data-ml-language'] = $langTitle;
if ($langKey != Yii::$app->lang->get()) {
$htmlOptions['class'] .= ' hidden';
$attributeName = $this->attribute . '_' . $langKey;
} else {
$attributeName = $this->attribute;
}
$content .= Html::tag('div', Widget::widget(['model' => $this->model, 'attribute' => $attributeName, 'settings' => $settings, 'plugins' => $this->plugins]), $htmlOptions);
}
$groupName = str_replace('\\', '', get_class($this->model) . '_' . $this->attribute . '_' . 'multilang');
$content = Html::tag('div', $content, ['data-ml-group' => $groupName, 'class' => 'ml-group-wrapper']);
Yii::$app->view->registerJs('$.fn.m22Multilang.register(\'[data-ml-group="' . $groupName . '"]\')', View::POS_READY);
foreach ($this->css as $style => $options) {
Yii::$app->view->registerCssFile($style, $options);
}
return $content;
}
作者:barie
项目:yii2-module-abstract-templat
* @var yii\web\View $this
* @var bariew\templateAbstractModule\models\Config $model
* @var yii\widgets\ActiveForm $form
*/
?>
<div class="config-form">
<?php
$form = ActiveForm::begin();
?>
<?php
$tabs = [['label' => Yii::t('app', 'Main'), 'content' => $this->render('_formMain', compact('form', 'model'))]];
foreach ($model->languageList() as $language) {
$tabs[] = ['label' => $language, 'active' => empty($active) && ($active = $model->hasErrors('content') || ($active = $model->hasErrors('subject'))), 'content' => $form->field($model, "subject[{$language}]", ['options' => ['class' => 'subjectInput']])->textInput() . $form->field($model, "content[{$language}]", ['options' => ['class' => 'messageInput']])->widget(\vova07\imperavi\Widget::className(), ['options' => ['style' => ['min-height' => '200px']], 'settings' => ['deniedTags' => [], 'convertDivs' => false, 'paragraphy' => false, 'formattingTags' => [], 'convertLinks' => false, 'cleanup' => false, 'removeEmptyTags' => false, 'cleanSpaces' => false, 'cleanFontTag' => false, 'tidyHtml' => false, 'paragraphize' => false, 'replaceDivs' => false, 'replaceTags' => false, 'replaceStyles' => false, 'removeEmpty' => false, 'minHeight' => 200]])];
}
?>
<?php
echo \yii\bootstrap\Tabs::widget(['items' => $tabs]);
?>
<label><?php
echo Yii::t('modules/template', 'Variables');
?>
</label>
<div class="configVariables">
<?php
echo DetailView::widget(['model' => false, 'attributes' => $model->variables()]);
?>
</div>
作者:heartshar
项目:dotplant
<?php
/**
* @var $attribute_name string
* @var $form \yii\widgets\ActiveForm
* @var $label string
* @var $model \app\properties\AbstractModel
* @var $multiple boolean
* @var $property_id integer
* @var $property_key string
* @var $this \app\properties\handlers\Handler
* @var $values array
*/
use vova07\imperavi\Widget as ImperaviWidget;
use yii\helpers\Url;
echo $form->field($model, $property_key . '[0]')->widget(ImperaviWidget::className(), ['settings' => ['replaceDivs' => false, 'minHeight' => 200, 'paragraphize' => true, 'pastePlainText' => true, 'buttonSource' => true, 'imageManagerJson' => Url::to(['/backend/dashboard/imperavi-images-get']), 'plugins' => ['table', 'fontsize', 'fontfamily', 'fontcolor', 'video', 'imagemanager'], 'replaceStyles' => [], 'replaceTags' => [], 'deniedTags' => [], 'removeEmpty' => [], 'imageUpload' => Url::to(['/backend/dashboard/imperavi-image-upload'])]]);
作者:vladkukushki
项目:yii2-article
<?php
echo $form->field($model, 'introtext')->textarea(['rows' => 12]);
?>
<?php
}
?>
</div> <!-- end col-lg-6 -->
<div class="col-lg-6">
<?php
if ($editor == "imperavi") {
?>
<?php
echo $form->field($model, 'fulltext')->widget(\vova07\imperavi\Widget::className(), ['settings' => ['minHeight' => 250, 'paragraphize' => false, 'cleanOnPaste' => false, 'replaceDivs' => false, 'linebreaks' => false, 'plugins' => ['fullscreen', 'imagemanager'], 'imageUpload' => Url::to(['/articles/items/image-upload']), 'imageManagerJson' => Url::to(['/articles/items/images-get'])]]);
?>
<?php
} else {
?>
<?php
echo $form->field($model, 'fulltext')->textarea(['rows' => 12]);
?>
<?php
}
?>
</div> <!-- end col-lg-6 -->
</div> <!-- end #item -->
作者:roman197
项目:li
<?php
echo $form->field($model, 'source_title')->widget(\yii\jui\AutoComplete::className(), ['clientOptions' => ['source' => $data, 'minLength' => '3', 'autoFill' => true], 'options' => ['class' => 'form-control']]);
?>
<?php
if (!$redactor) {
?>
<?php
echo $form->field($model, 'body')->textarea(['rows' => 5, 'cols' => 5, 'id' => 'my-textarea-id']);
?>
<?php
} else {
?>
<?php
echo $form->field($model, 'body')->widget(Widget::classname(), ['settings' => ['lang' => 'ru', 'minHeight' => 300, 'pastePlainText' => true, 'buttonSource' => true, 'plugins' => ['clips', 'fullscreen'], 'imageUpload' => Url::to(['/articles/image-upload'])]]);
?>
<?php
}
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Создать' : 'Обновить', ['class' => 'btn btn-primary', 'name' => 'create-button']);
?>
</div>
<?php
ActiveForm::end();
作者:averj
项目:yii2-content-modul
case Content::ATTR_TYPE_TITLE:
echo $form->field($model, $attr)->textInput(isset($value['config']) ? $value['config'] : []);
$titleAttribute = $attr;
break;
case Content::ATTR_TYPE_STRING:
echo $form->field($model, $attr)->textInput(isset($value['config']) ? $value['config'] : []);
break;
case Content::ATTR_TYPE_INTEGER:
echo $form->field($model, $attr)->input('number', isset($value['config']) ? $value['config'] : []);
break;
case Content::ATTR_TYPE_URL:
echo $form->field($model, $attr, ['template' => '{label}<div class="input-group"><span class="input-group-addon attached-button-chain"><i class="icon fa fa-chain"></i></span>{input}</div> {hint}{error}'])->textInput(isset($value['config']) ? $value['config'] : []);
$urlAttribute = $attr;
break;
case Content::ATTR_TYPE_ADVANCED_TEXT:
echo $form->field($model, $attr, ['options' => ['class' => 'form-group col-sm-12']])->widget(Widget::className(), isset($value['config']) ? $value['config'] : []);
break;
case Content::ATTR_TYPE_IMAGE:
echo $form->field($model, $attr)->widget(FileAPI::className(), isset($value['config']) ? $value['config'] : []);
break;
case Content::ATTR_TYPE_TEXT:
echo $form->field($model, $attr)->textarea(isset($value['config']) ? $value['config'] : []);
break;
case Content::ATTR_TYPE_DATE:
echo $form->field($model, $attr)->widget(DateTimePicker::classname(), isset($value['config']) ? $value['config'] : []);
break;
case Content::ATTR_TYPE_BOOLEAN:
echo $form->field($model, $attr)->checkbox();
break;
case Content::ATTR_TYPE_DROPDOWN:
echo $form->field($model, $attr)->dropDownList(isset($value['items']) ? $value['items'] : [], isset($value['config']) ? $value['config'] : []);
作者:voodoo-mobil
项目:yii2-imperavi-widge
/**
* @inheritdoc
*/
public function init()
{
if ($this->url === null) {
throw new InvalidConfigException('The "url" attribute must be set.');
} else {
$this->url = rtrim($this->url, '/') . '/';
}
if ($this->path === null) {
throw new InvalidConfigException('The "path" attribute must be set.');
} else {
$this->path = rtrim(Yii::getAlias($this->path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
if (!FileHelper::createDirectory($this->path)) {
throw new InvalidCallException("Directory specified in 'path' attribute doesn't exist or cannot be created.");
}
}
if ($this->uploadOnlyImage !== true) {
$this->_validator = 'file';
}
Widget::registerTranslations();
}
作者:s-savchenk
项目:ais
JS;
$this->registerJs($js);
?>
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'slug')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'announcement')->textarea(['rows' => 6]);
echo $form->field($model, 'content')->widget(Widget::className(), ['settings' => ['lang' => 'ru', 'minHeight' => 200, 'imageUpload' => Url::to(['page/image-upload']), 'plugins' => ['fullscreen', 'fontcolor', 'table', 'clips']]]);
?>
<?php
echo $form->field($model, 'is_available')->checkbox();
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
作者:pazjacke
项目:fiilatovnick-_-yii2-multilingual-dem
<?php
/** @var \yii\web\View $this */
/** @var integer $language_id */
/** @var \DevGroup\Multilingual\models\Language $language */
/** @var \app\models\PageTranslation $model */
/** @var string $attributePrefix */
/** @var \yii\widgets\ActiveForm $form */
use yii\helpers\Url;
echo $form->field($model, $attributePrefix . 'title');
echo $form->field($model, $attributePrefix . 'is_published')->widget(kartik\widgets\SwitchInput::className());
echo $form->field($model, $attributePrefix . 'content')->widget(\vova07\imperavi\Widget::className(), ['settings' => ['minHeight' => 200, 'plugins' => ['table', 'fontsize', 'fontfamily', 'fontcolor', 'video', 'imagemanager', 'clips', 'fullscreen', 'filemanager'], 'pastePlainText' => true, 'buttonSource' => true, 'replaceStyles' => [], 'replaceTags' => [], 'deniedTags' => [], 'removeEmpty' => [], 'imageUpload' => Url::to(['/admin/image-upload']), 'imageManagerJson' => Url::to(['/admin/images-get']), 'fileUpload' => Url::to(['/admin/file-upload']), 'fileManagerJson' => Url::to(['/admin/files-get'])]]);
?>
<!-- ok -->
作者:hdushk
项目:blo
<?php
echo $form->field($model, 'title')->textInput(['maxlength' => 65, 'placeholder' => Yii::t('app', 'Title contain a seo keyword if possible')]);
?>
</div>
</div>
<?php
echo $form->field($model, 'description')->textArea(['maxlength' => 155, 'placeholder' => Yii::t('app', 'This description also used as meta description')]);
?>
<?php
$isettings = ['lang' => substr(Yii::$app->language, 0, 2), 'minHeight' => 400, 'toolbarFixedTopOffset' => 50, 'buttonSource' => true, 'plugins' => ['imagemanager', 'filemanager', 'video', 'table', 'clips', 'fullscreen'], 'buttons' => ['html', 'formatting', 'bold', 'italic', 'underline', 'deleted', 'unorderedlist', 'orderedlist', 'outdent', 'indent', 'image', 'file', 'link', 'alignment', 'horizontalrule'], 'replaceDivs' => false, 'deniedTags' => ['script']];
if ($module->enableUpload) {
$isettings = array_merge($isettings, ['imageUpload' => Url::to(['//blog/default/image-upload']), 'fileUpload' => Url::to(['//blog/default/file-upload']), 'imageManagerJson' => Url::to(['//blog/default/images-get']), 'fileManagerJson' => Url::to(['//blog/default/files-get'])]);
}
use vova07\imperavi\Widget;
echo $form->field($model, 'content')->widget(Widget::className(), ['settings' => $isettings, 'options' => ["style" => "width:100%"]]);
?>
<?php
if ($module->enableScriptsPage) {
?>
<?php
echo $form->field($model, 'scripts')->textArea(['rows' => 6, 'placeholder' => Yii::t('app', 'JavaScripts')]);
?>
<?php
}
?>
</div>
<div class="col-md-3">
<div class="well">
作者:alexsynytski
项目:Dynamomani
// 'url' => $url,
// 'dataType' => 'json',
// 'data' => new JsExpression('function(term,page) { return {search:term}; }'),
// 'results' => new JsExpression('function(data,page) { return {results:data.results}; }'),
// ],
// 'initSelection' => new JsExpression($initScript),
// ],
// ]);
?>
<?php
echo $form->field($model, 'title')->textInput(['maxlength' => 255]);
?>
<?php
echo $form->field($model, 'content')->widget(\vova07\imperavi\Widget::className(), ['plugins' => ['quote' => 'backend\\assets\\EditorAssetBundle', 'skip' => 'backend\\assets\\EditorAssetBundle'], 'settings' => ['lang' => 'ru', 'minHeight' => 200, 'imageUpload' => \yii\helpers\Url::to(['/site/image-upload']), 'buttons' => ['html', 'formatting', 'bold', 'italic', 'underline', 'deleted', 'unorderedlist', 'orderedlist', 'outdent', 'indent', 'image', 'link', 'alignment', 'quote', 'skip'], 'plugins' => ['fullscreen', 'table', 'video', 'fontcolor'], 'deniedTags' => ['style'], 'replaceDivs' => false]]);
?>
<div class="row">
<div class="col-sm-6">
<?php
$source = [];
if (!$model->isNewRecord) {
if (isset($model->source_title) && trim($model->source_title) != '') {
$source = [0 => $model->source_title];
}
}
echo $form->field($model, 'source_id')->widget(SelectizeDropDownList::classname(), ['loadUrl' => Url::to(['source/source-list']), 'items' => $source, 'options' => ['multiple' => false], 'clientOptions' => ['valueField' => 'value', 'labelField' => 'text', 'persist' => false]]);
?>
</div>
作者:RStuffGi
项目:mebe
/* @var $model common\models\TextPages */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="text-pages-form">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'text')->widget(Widget::className(), ['settings' => ['lang' => 'ru', 'minHeight' => 200, 'replaceDivs' => false, 'imageUpload' => Url::to(['/text-pages/image-upload']), 'plugins' => ['clips', 'fullscreen', 'table', 'filemanager', 'fontcolor', 'fontfamily', 'fontsize', 'limiter', 'video', 'textdirection', 'textexpander', 'imagemanager']]]);
?>
<?php
echo $form->field($model, 'url')->textInput(['maxlength' => true]);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Создать' : 'Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
作者:BeforyDeat
项目:trave
?>
<?php
echo $form->field($model, 'project_id')->dropdownList(\common\models\Project::find()->select(['domain', 'id'])->indexBy('id')->column(), ['prompt' => 'Domain:'])->label('Domain');
?>
<?php
echo $form->field($model, 'alias')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'content')->widget(\vova07\imperavi\Widget::className(), ['settings' => ['replaceDivs' => false, 'lang' => 'ru', 'minHeight' => 200, 'plugins' => ['clips', 'fullscreen'], 'pastePlainText' => false, 'paragraphize' => false]]);
?>
<?php
echo $form->field($model, 'as_theme')->dropdownList([1 => 'yes', 0 => 'no']);
?>
<?php
echo $form->field($model, 'META_TITLE')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'META_DESC')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'META_KEYS')->textInput(['maxlength' => true]);
作者:kibercode
项目:bilious-octo-fibul
<?php
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use kartik\widgets\ActiveForm;
use kartik\builder\Form;
use kartik\datecontrol\DateControl;
use kartik\widgets\FileInput;
use kartik\builder\TabularForm;
/**
* @var yii\web\View $this
* @var common\models\SliderImage $model
* @var yii\widgets\ActiveForm $form
*/
?>
<div class="slider-image-form">
<?php
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'options' => ['enctype' => 'multipart/form-data']]);
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 1, 'attributes' => ['publish_flag' => ['type' => Form::INPUT_CHECKBOX, 'options' => ['placeholder' => yii::t('app', 'Enter') . ' Опубликовано...']], 'slider' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => yii::t('app', 'Enter') . ' Слайдер...']], 'href' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => yii::t('app', 'Enter') . ' Ссылка...', 'maxlength' => 255]], 'body' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => \vova07\imperavi\Widget::className(), 'options' => ['settings' => ['toolbarFixed' => false, 'minHeight' => 100]]], 'menu_image' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => kartik\widgets\FileInput::className(), 'options' => ['pluginOptions' => ['accept' => 'image/*', 'allowedFileExtensions' => ['jpg', 'gif', 'png'], 'showRemove' => false, 'showUpload' => false, 'initialPreview' => $model->getUploadUrl('menu_image') ? Html::img($model->getUploadUrl('menu_image'), ['class' => 'file-preview-image']) : false, 'maxFileCount' => 1]]], 'href_enabled_flag' => ['type' => Form::INPUT_CHECKBOX, 'options' => ['placeholder' => yii::t('app', 'Enter') . ' Показывать кнопку перейти...']], 'created_date' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => DateControl::classname(), 'options' => ['type' => DateControl::FORMAT_DATE]], 'iframe_href' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => yii::t('app', 'Enter') . ' Ссылка на iframе(если указан изображения игнорируются)...', 'maxlength' => 255]], 'banner_image' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => kartik\widgets\FileInput::className(), 'options' => ['pluginOptions' => ['accept' => 'image/*', 'allowedFileExtensions' => ['jpg', 'gif', 'png'], 'showRemove' => false, 'showUpload' => false, 'initialPreview' => $model->getUploadUrl('banner_image') ? Html::img($model->getUploadUrl('banner_image'), ['class' => 'file-preview-image']) : false, 'maxFileCount' => 1]]], 'banner_phone_image' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => kartik\widgets\FileInput::className(), 'options' => ['pluginOptions' => ['accept' => 'image/*', 'allowedFileExtensions' => ['jpg', 'gif', 'png'], 'showRemove' => false, 'showUpload' => false, 'initialPreview' => $model->getUploadUrl('banner_phone_image') ? Html::img($model->getUploadUrl('banner_phone_image'), ['class' => 'file-preview-image']) : false, 'maxFileCount' => 1]]], 'banner_tablet_image' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => kartik\widgets\FileInput::className(), 'options' => ['pluginOptions' => ['accept' => 'image/*', 'allowedFileExtensions' => ['jpg', 'gif', 'png'], 'showRemove' => false, 'showUpload' => false, 'initialPreview' => $model->getUploadUrl('banner_tablet_image') ? Html::img($model->getUploadUrl('banner_tablet_image'), ['class' => 'file-preview-image']) : false, 'maxFileCount' => 1]]]]]);
echo Html::button(Yii::t('app', 'Cancel'), ['class' => 'btn btn-default', 'style' => 'margin-right: 20px', 'onclick' => 'window.location = "' . Url::to(['index']) . '"']);
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save'), ['class' => 'btn btn-primary', 'style' => 'margin-right: 10px', 'name' => 'goto', 'value' => 'list']);
echo Html::submitButton(Yii::t('app', 'Apply'), ['class' => 'btn btn-primary', 'style' => 'margin-right: 0px']);
ActiveForm::end();
?>
</div>
作者:VitaliyProda
项目:h
/* @var $model common\models\Post */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="post-form">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'title')->textInput(['maxlength' => 255]);
?>
<?php
echo \vova07\imperavi\Widget::widget(['model' => $model, 'attribute' => 'content', 'settings' => ['lang' => 'ru', 'minHeight' => 200, 'imageUpload' => Url::to(['/post/image-upload']), 'imageManagerJson' => Url::to(['/post/images-get']), 'fileUpload' => Url::to(['/post/file-upload']), 'fileManagerJson' => Url::to(['/post/files-get']), 'plugins' => ['fullscreen', 'filemanager', 'imagemanager', 'video']]]);
?>
<?php
echo $form->field($model, 'category_id')->dropDownList($model->categoryList());
?>
<?php
echo $form->field($model, 'active')->checkbox();
?>
<?php
echo $form->field($model, 'featured')->checkbox();
?>
<?php
作者:kibercode
项目:bilious-octo-fibul
use common\widgets\elfinder\InputFile;
use yii\bootstrap\Modal;
use mihaildev\elfinder\ElFinder;
use yii\web\JsExpression;
/**
* @var yii\web\View $this
* @var common\models\Post $model
* @var yii\widgets\ActiveForm $form
*/
?>
<div class="post-form">
<?php
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'options' => ['enctype' => 'multipart/form-data']]);
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 1, 'attributes' => ['title' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => yii::t('app', 'Enter') . ' Заголовок...', 'maxlength' => 255]], 'intro' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => \vova07\imperavi\Widget::className(), 'options' => ['settings' => ['toolbarFixed' => false, 'minHeight' => 100, 'plugins' => ['elfinder', 'fontcolor']]]], 'body' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => \vova07\imperavi\Widget::className(), 'options' => ['settings' => ['toolbarFixed' => false, 'minHeight' => 100]]], 'user_id' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => kartik\widgets\Select2::className(), 'options' => ['data' => ArrayHelper::map(common\models\User::find()->all(), 'id', 'username'), 'options' => ['placeholder' => 'Выбрать...'], 'pluginOptions' => ['allowClear' => true]]], 'category_id' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => kartik\widgets\Select2::className(), 'options' => ['data' => ArrayHelper::map(common\models\PostCategory::find()->all(), 'id', 'title'), 'options' => ['placeholder' => 'Выбрать...'], 'pluginOptions' => ['allowClear' => true]]], 'state_index' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => kartik\widgets\Select2::className(), 'options' => ['data' => (new common\models\Post())->getStateIndexList(), 'options' => ['placeholder' => 'Выбрать...'], 'pluginOptions' => ['allowClear' => true]]], 'main_flag' => ['type' => Form::INPUT_CHECKBOX, 'options' => ['placeholder' => yii::t('app', 'Enter') . ' Главная...']], 'noforeign_id' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => yii::t('app', 'Enter') . ' Noforeign ID...', 'maxlength' => 11]], 'created_datetime' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => DateControl::classname(), 'options' => ['type' => DateControl::FORMAT_DATETIME]], 'start_date' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => DateControl::classname(), 'options' => ['type' => DateControl::FORMAT_DATE]], 'start_time' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => DateControl::classname(), 'options' => ['type' => DateControl::FORMAT_TIME]], 'preview_image' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => InputFile::className(), 'options' => ['language' => 'ru', 'controller' => 'elfinder', 'filter' => 'image', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-default'], 'multiple' => false, 'path' => 'news']], 'doc_file' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => InputFile::className(), 'options' => ['language' => 'ru', 'controller' => 'elfinder', 'filter' => 'image', 'options' => ['class' => 'form-control'], 'buttonOptions' => ['class' => 'btn btn-default'], 'multiple' => false, 'path' => 'news']]]]);
/*
?>
<script>
if (!RedactorPlugins) var RedactorPlugins = {};
RedactorPlugins.elfinder = function()
{
return {
init: function()
{
var elfinder = this.button.add('elfinder', 'Elfinder');
this.button.setAwesome('elfinder', 'fa-elfinder');
this.button.addCallback(elfinder, this.elfinder.openElfinder);
},
openElfinder: function()
{
作者:vetal240
项目:exampl
<?php
use vova07\imperavi\Widget;
?>
<div class="col-md-12">
<div class="row">
<?php
echo $form->field($modelHotelData, 'lang_id[]')->hiddenInput(['value' => $language->local])->label(false);
?>
<div class="control-label">Description</div>
<?php
echo Widget::widget(['name' => 'HotelData[description][]', 'value' => $modelHotelData->description, 'settings' => ['minHeight' => 200, 'plugins' => ['clips']]]);
?>
<div class="control-label">Location</div>
<?php
echo Widget::widget(['name' => 'HotelData[location][]', 'value' => $modelHotelData->location, 'settings' => ['minHeight' => 200, 'plugins' => ['clips']]]);
?>
<div class="control-label">Price information</div>
<?php
echo Widget::widget(['name' => 'HotelData[price_information][]', 'value' => $modelHotelData->price_information, 'settings' => ['minHeight' => 200, 'plugins' => ['clips']]]);
?>
<div class="control-label">Other</div>
<?php
echo Widget::widget(['name' => 'HotelData[other][]', 'value' => $modelHotelData->other, 'settings' => ['minHeight' => 200, 'plugins' => ['clips']]]);
?>
</div>
</div>
作者:noiki
项目:wowew
<div class="mhelpdoc-form">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'title')->textInput(['maxlength' => 128])->hint("为了在手机上显示美观,建议不超过20个字");
?>
<!--
<//?= $form->field($model, 'content')->textarea(['rows' => 6]) ?>
-->
<?php
echo $form->field($model, 'content')->widget(Widget::className(), ['settings' => ['lang' => 'zh_cn', 'minHeight' => 200, 'maxHeight' => 400, 'buttonSource' => true, 'convertDivs' => false, 'removeEmptyTags' => false, 'plugins' => ['clips', 'fullscreen', 'fontcolor', 'fontfamily', 'fontsize', 'limiter', 'table', 'textexpander', 'textdirection', 'video', 'definedlinks', 'filemanager', 'imagemanager'], 'imageManagerJson' => Url::to(['/helpdoc/imagesget']), 'imageUpload' => Url::to(['/helpdoc/imageupload'])]])->hint("为了在手机上显示美观,建议使用字体18px");
?>
<!--
<//?= $form->field($model, 'sort')->textInput() ?>
-->
<!--
<//?= $form->field($model, 'visual')->textInput() ?>
-->
<?php
echo $form->field($model, 'visual')->dropDownList(MHelpdoc::getVisualOption());
?>
作者:mops1
项目:yiimin
<?php
$form = ActiveForm::begin(['layout' => 'horizontal', 'options' => ['enctype' => 'multipart/form-data']]);
?>
<?php
echo $form->field($model, 'app_name')->textInput();
?>
<?php
echo $form->field($model, 'app_logo')->fileInput();
if ($model->app_logo) {
echo "<div class='form-group'><div class='col-sm-offset-3 col-sm-9'>";
echo Html::img('/uploads/settings/app_logo/' . $model->app_logo, ['class' => 'img-thumbnail', 'width' => 150]);
echo "</div></div>";
}
?>
<?php
echo $form->field($model, 'app_description')->widget(Widget::classname(), ['settings' => ['lang' => 'ru', 'minHeight' => 300, 'pastePlainText' => true, 'buttonSource' => true, 'plugins' => ['clips', 'fullscreen']]]);
?>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-9">
<?php
echo Html::submitButton(\Yii::t('app', 'Save'), ['class' => 'btn btn-primary']);
?>
</div>
</div>
<?php
ActiveForm::end();
?>
</div>
作者:porcelanos
项目:yii2-option
<?php
use yii\helpers\Html;
use vova07\imperavi\Widget as Redactor;
use porcelanosa\yii2options\models\OptionsList;
use yii\helpers\Url;
/**
* @var $optionList OptionsList
* @var $option_name string
* @var $richTextValue string
* @var $behavior \porcelanosa\yii2options\OptionsBehavior
*/
?>
<div id="rich-text-<?php
echo $optionList->name;
?>
">
<label> <?php
echo $optionList->name;
?>
</label>
<?php
echo Html::textarea($option_name, $richTextValue, ['id' => $option_name]);
?>
<?php
echo Redactor::widget(['selector' => '#' . $option_name, 'settings' => ['lang' => 'ru', 'minHeight' => 200, 'maxHeight' => 600, 'structure' => true, 'imageManagerJson' => Url::to(['/options/images/images-get']), 'fileManagerJson' => Url::to(['/options/images/files-get']), 'imageUpload' => Url::to(['/options/images/image-upload']), 'fileUpload' => Url::to(['/options/images/file-upload']), 'plugins' => ['clips', 'fullscreen']]]);
?>
</div>