当前位置: 首页>>代码示例>>PHP>>正文


PHP Widget::widget方法代码示例

本文整理汇总了PHP中vova07\imperavi\Widget::widget方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::widget方法的具体用法?PHP Widget::widget怎么用?PHP Widget::widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vova07\imperavi\Widget的用法示例。


在下文中一共展示了Widget::widget方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 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;
 }
开发者ID:griga,项目名称:m22-cms,代码行数:23,代码来源:RedactorWidget.php

示例2:

<?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>&nbsp;<?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>
		
开发者ID:porcelanosa,项目名称:yii2-options,代码行数:28,代码来源:_rich_text.php

示例3: JsExpression

<?php

use vova07\imperavi\Widget;
use yii\bootstrap\Tabs;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\web\JsExpression;
/**
 * @var yii\web\View $this
 * @var string $attribute
 * @var array $options
 * @var array $languages
 */
$tabs = [];
foreach ($languages as $language) {
    if ($options['redactor']) {
        $content = Widget::widget(['model' => $model->translate($language->locale), 'attribute' => "[{$language->locale}]" . $attribute, 'name' => $model->translate($language->locale)->formName() . "[{$language->locale}][" . $attribute . "]", 'options' => ['class' => 'wysiwygTextArea'], 'settings' => ['lang' => Yii::$app->getModule('radiata')->activeLanguage['code'], 'minHeight' => 300, 'pastePlainText' => true, 'buttonSource' => true, 'replaceDivs' => false, 'plugins' => ['fullscreen', 'imagemanager', 'filemanager'], 'imageUpload' => Url::to([$options['urlPreffix'] . 'image-upload']), 'imageManagerJson' => Url::to([$options['urlPreffix'] . 'images-get']), 'fileManagerJson' => Url::to([$options['urlPreffix'] . 'files-get']), 'fileUpload' => Url::to([$options['urlPreffix'] . 'file-upload']), 'callbacks' => ['change' => new JsExpression('function() {

                    }')]]]);
    } else {
        $content = Html::$options['type']($model->translate($language->locale), "[{$language->locale}]" . $attribute, ['class' => 'form-control' . $options['additionalCssClasses']]);
    }
    $tabs[] = ['label' => '<i class="iconflags iconflags-' . $language->code . '"></i> ' . $language->code, 'encode' => false, 'content' => $content, 'active' => $language->locale == Yii::$app->language, 'linkOptions' => ['lang' => $language->locale, 'class' => 'lang-tab-a', 'title' => $language->locale]];
}
if (count($languages) > 1) {
    echo Tabs::widget(['items' => $tabs, 'id' => $options['id']]);
} else {
    echo $tabs[0]['content'];
}
开发者ID:radiata-cms,项目名称:radiata,代码行数:29,代码来源:LangInput.php

示例4:

/* @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 
开发者ID:VitaliyProdan,项目名称:hr,代码行数:31,代码来源:_form.php

示例5:

<?php

use yii\bootstrap\Modal;
use app\models\R;
use yii\helpers\Html;
Modal::begin(['tag' => 'span', 'size' => 'modal-lg', 'header' => '<h4><b>Отправка на рассмотрение менеджеру</b><h4>', 'toggleButton' => ['label' => ''], 'footer' => '<button class="btn btn-primary" onclick="send(this, ' . $assignment->id . ')"><span></span> Отправить</button>', 'id' => 'viewDo_' . $assignment->id]);
echo \vova07\imperavi\Widget::widget(['name' => 'report_text', 'id' => 'text_' . $assignment->id, 'settings' => ['lang' => 'ru', 'minHeight' => 200, 'plugins' => ['clips', 'fullscreen', 'fontsize', 'fontcolor']]]);
echo \kato\DropZone::widget(['options' => ['maxFilesize' => '10', 'url' => 'upload/'], 'dropzoneContainer' => 'dropzone' . $assignment->id, 'previewsContainer' => 'dropzone' . $assignment->id]);
Modal::end();
开发者ID:Sheriyev,项目名称:G5-CRM,代码行数:9,代码来源:_do-assign.php

示例6:

<?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>
开发者ID:vetal2409,项目名称:example,代码行数:29,代码来源:_hotelData.php

示例7: launch

 protected function launch()
 {
     switch ($this->editor) {
         case self::EDITOR_CKEDITOR_BASIC:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('grom/media/manager', ['filebrowserBrowseUrl' => ['/grom/menu/backend/item/ckeditor-select'], 'extraPlugins' => 'codesnippet', 'preset' => 'basic', 'tabSpaces' => 4])]);
             break;
         case self::EDITOR_CKEDITOR_STANDARD:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('grom/media/manager', ['filebrowserBrowseUrl' => ['/grom/menu/backend/item/ckeditor-select'], 'extraPlugins' => 'codesnippet', 'preset' => 'standard', 'tabSpaces' => 4])]);
             break;
         case self::EDITOR_CKEDITOR_FULL:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('grom/media/manager', ['filebrowserBrowseUrl' => ['/grom/menu/backend/item/ckeditor-select'], 'extraPlugins' => 'codesnippet', 'preset' => 'full', 'tabSpaces' => 4])]);
             break;
         case self::EDITOR_IMPERAVI:
             echo Widget::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value]);
             break;
         default:
             echo $this->hasModel() ? Html::activeTextarea($this->model, $this->attribute, $this->options) : Html::textarea($this->name, $this->value, $this->options);
     }
 }
开发者ID:gromver,项目名称:yii2-platform-basic,代码行数:19,代码来源:HtmlEditor.php

示例8: launch

 protected function launch()
 {
     switch ($this->editor) {
         case self::EDITOR_CKEDITOR_BASIC:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('media/manager', array_merge($this->ckEditorOptions, ['filebrowserBrowseUrl' => ['/menu/backend/item/ckeditor-select'], 'preset' => 'basic', 'tabSpaces' => 4, 'autoGrow_onStartup' => true, 'autoGrow_bottomSpace' => 50]))]);
             break;
         case self::EDITOR_CKEDITOR_STANDARD:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('media/manager', array_merge($this->ckEditorOptions, ['filebrowserBrowseUrl' => ['/menu/backend/item/ckeditor-select'], 'preset' => 'standard', 'tabSpaces' => 4, 'autoGrow_onStartup' => true, 'autoGrow_bottomSpace' => 50]))]);
             break;
         case self::EDITOR_CKEDITOR_FULL:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('media/manager', array_merge($this->ckEditorOptions, ['filebrowserBrowseUrl' => ['/menu/backend/item/ckeditor-select'], 'preset' => 'full', 'tabSpaces' => 4, 'autoGrow_onStartup' => true, 'autoGrow_bottomSpace' => 50]))]);
             break;
         case self::EDITOR_IMPERAVI:
             echo Imperavi::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'settings' => $this->imperaviOptions]);
             break;
         default:
             echo $this->hasModel() ? Html::activeTextarea($this->model, $this->attribute, $this->options) : Html::textarea($this->name, $this->value, $this->options);
     }
 }
开发者ID:gromver,项目名称:yii2-platform-core,代码行数:19,代码来源:HtmlEditor.php

示例9:

		<div class="col-md-6">
		<?php 
Box::begin(['header' => 'Imperavi']);
?>
			<?php 
echo Widget::widget(['name' => 'redactor', 'settings' => ['lang' => 'en', 'minHeight' => 200, 'plugins' => ['clips', 'fullscreen']]]);
?>
			<?php 
highlight_string("\n<?php\nuse vova07\\imperavi\\Widget;\n\necho Widget::widget([\n    'name' => 'redactor',\n    'settings' => [\n        'lang' => 'en',\n        'minHeight' => 200,\n        'plugins' => [\n            'clips',\n            'fullscreen'\n        ]\n    ]\n]);\n?>\t\n\t\t\t");
?>
		<?php 
Box::end();
?>
		</div><!-- /.col (LEFT) -->
		<div class="col-md-6">
		<?php 
Box::begin(['header' => 'Imperavi']);
?>
			<?php 
echo Widget::widget(['name' => 'redactor2', 'settings' => ['lang' => 'en', 'minHeight' => 200, 'fileUpload' => Url::to(['/default/file-upload']), 'imageManagerJson' => Url::to(['/default/images-get']), 'fileManagerJson' => Url::to(['/default/files-get']), 'plugins' => ['imagemanager', 'filemanager']]]);
?>
			<?php 
highlight_string("\n<?php\nuse vova07\\imperavi\\Widget;\n\necho Widget::widget([\n    'name' => 'redactor',\n    'settings' => [\n        'lang' => 'en',\n        'minHeight' => 200,\n        'plugins' => [\n            'clips',\n            'fullscreen'\n        ]\n    ]\n]);\n?>\t\n\t\t\t");
?>
		<?php 
Box::end();
?>
		</div><!-- /.col (LEFT) -->
	</div>
<?php 
Box::end();
开发者ID:kucheriavij,项目名称:yii2-adminlte,代码行数:31,代码来源:imperavi.php

示例10:

        <div class="col-md-12">
            <?php 
echo $form->field($invoice, 'newAmount')->textInput();
?>

            <?php 
echo Html::label('Subject', 'Invoice[subject]');
?>
            <?php 
echo Widget::widget(['name' => 'Invoice[subject]', 'value' => $invoice->subject, 'settings' => ['minHeight' => 200, 'plugins' => ['clips']]]);
?>

            <?php 
echo Html::label('Final Text', 'Invoice[finalText]');
?>
            <?php 
echo Widget::widget(['name' => 'Invoice[finalText]', 'value' => $invoice->finalText, 'settings' => ['minHeight' => 200, 'plugins' => ['clips']]]);
?>
            <div class="col-md-offset-6 text-right">
                <?php 
echo Html::submitButton('Show Template', ['class' => 'btn btn-primary', 'id' => 'show-credit-note']);
?>
                <?php 
echo Html::submitButton('Create credit note', ['class' => 'btn btn-success', 'id' => 'create-credit-note']);
?>
            </div>
        </div>
    </div>

<?php 
$form->end();
开发者ID:vetal2409,项目名称:example,代码行数:31,代码来源:credit_note.php

示例11: foreach

</div>
		<p>

			<span><b>Файлы:</b></span>
			<div class="clear"></div>
			<?php 
foreach ($bid->attachments as $file) {
    ?>
				<a href="<?php 
    echo $file->path;
    ?>
" target="_blank"><?php 
    echo $file->name;
    ?>
</a>
				<div class="clear"></div>
				<?php 
}
?>
		</p>
	
    </div>
    <div class="col-xs-6 border-red">
    	<center><b>Комментарий к отчету</b></center>
    	<?php 
echo \vova07\imperavi\Widget::widget(['name' => 'report_text', 'id' => 'text_' . $bid->id, 'settings' => ['lang' => 'ru', 'minHeight' => 200, 'plugins' => ['clips', 'fullscreen']]]);
echo \kato\DropZone::widget(['options' => ['maxFilesize' => '10', 'url' => 'upload/'], 'dropzoneContainer' => 'dropzone' . $bid->id, 'previewsContainer' => 'dropzone' . $bid->id]);
?>
    </div>
	<?php 
Modal::end();
开发者ID:Sheriyev,项目名称:G5-CRM,代码行数:31,代码来源:_view.php

示例12:

?>

    <?php 
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>

    <?php 
\vova07\imperavi\Widget::widget(['model' => $model, 'attribute' => 'description', 'settings' => ['lang' => 'ru', 'minHeight' => 200, 'plugins' => ['fontsize', 'fontcolor', 'fontfamily']]]);
?>

    <?php 
echo $form->field($model, 'properties')->textarea(['rows' => 6]);
?>

    <?php 
\vova07\imperavi\Widget::widget(['model' => $model, 'attribute' => 'properties', 'settings' => ['lang' => 'ru', 'minHeight' => 200, 'plugins' => ['fontsize', 'fontcolor', 'fontfamily']]]);
?>

    <?php 
echo $form->field($model, 'parent_id')->dropDownList(Categories::getDropDown(), ['prompt' => 'Выберите родительскую категорию']);
?>

    <?php 
echo $form->field($model, 'active')->dropDownList(Categories::$activeText);
?>

    <?php 
echo $form->field($model, 'meta_title')->textInput(['maxlength' => true]);
?>

    <?php 
开发者ID:stronglab,项目名称:yii2-product-catalog,代码行数:31,代码来源:_form.php

示例13: uniqid

<div class="form-group">
    <?php 
if ($label) {
    ?>
<label class="control-label"><?php 
    echo $label;
    ?>
</label><?php 
}
?>
    <?php 
echo \vova07\imperavi\Widget::widget(['name' => $name, 'value' => $value, 'id' => uniqid('wysiwyg_'), 'settings' => ['lang' => 'ru', 'minHeight' => $item['height'] ? $item['height'] : "200", 'plugins' => ['fullscreen', 'table', 'fontcolor', 'fontfamily'], 'buttons' => ['formatting', 'bold', 'italic', 'deleted', 'underline', 'lists', 'image', 'link', 'horizontalrule', 'unorderedlist', 'orderedlist', 'alignment'], 'media_library_url' => \yii\helpers\Url::to(['/media/default/wysiwyg-window']), "allowedAttr" => [['input', '*'], ['td', '*'], ['a', '*'], ['img', '*'], ['span', '*'], ['iframe', '*'], ['video', '*'], ['audio', '*'], ['embed', '*'], ['object', '*'], ['param', '*'], ['source', '*']]], 'options' => ['data-name' => $name], 'plugins' => ['media_library' => 'lenarx\\media\\ImperaviAssets']]);
?>

</div>



开发者ID:lenarx,项目名称:yii2-cms-settings,代码行数:15,代码来源:wysiwyg.php


注:本文中的vova07\imperavi\Widget::widget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。