本文整理汇总了PHP中app\backend\widgets\BackendWidget::begin方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendWidget::begin方法的具体用法?PHP BackendWidget::begin怎么用?PHP BackendWidget::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\backend\widgets\BackendWidget
的用法示例。
在下文中一共展示了BackendWidget::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'save']);
?>
</div>
<?php
$this->endBlock();
?>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<?php
$form = ActiveForm::begin();
?>
<?php
BackendWidget::begin(['icon' => 'user', 'title' => Yii::t('app', 'User'), 'footer' => $this->blocks['submit']]);
?>
<?php
echo $form->field($model, 'username')->textInput(['maxlength' => 255, 'autocomplete' => 'off']);
?>
<?php
echo $form->field($model, 'password')->textInput(['maxlength' => 255]);
?>
<?php
echo $form->field($model, 'status')->dropDownList($model->getStatuses());
?>
<?php
echo $form->field($model, 'email')->textInput(['maxlength' => 255]);
?>
<?php
echo $form->field($model, 'first_name')->textInput(['maxlength' => 255]);
示例2:
<?php
/* @var $this yii\web\View */
/* @var $model app\modules\shop\models\CategoryGroup */
use app\backend\widgets\BackendWidget;
use kartik\helpers\Html;
use kartik\icons\Icon;
use kartik\widgets\ActiveForm;
$this->title = $model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update');
$this->params['breadcrumbs'] = [['label' => Yii::t('app', 'Categories groups'), 'url' => ['index']], $this->params['breadcrumbs'][] = $this->title];
?>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<?php
$form = ActiveForm::begin();
?>
<?php
BackendWidget::begin(['icon' => 'tag', 'title' => Yii::t('app', 'Categories groups'), 'footer' => Html::a(Icon::show('arrow-circle-left') . Yii::t('app', 'Back'), Yii::$app->request->get('returnUrl', ['index', 'id' => $model->id]), ['class' => 'btn btn-danger']) . ' ' . ($model->isNewRecord ? Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go next'), ['class' => 'btn btn-success', 'name' => 'action', 'value' => 'next']) : '') . ' ' . Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go back'), ['class' => 'btn btn-warning', 'name' => 'action', 'value' => 'back']) . ' ' . Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'save'])]);
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => 255]);
?>
<?php
BackendWidget::end();
?>
<?php
ActiveForm::end();
?>
</div>
示例3: JsExpression
echo $form->field($model, 'content')->widget(Yii::$app->getModule('core')->wysiwyg_class_name(), Yii::$app->getModule('core')->wysiwyg_params());
?>
<?php
BackendWidget::end();
?>
</article>
</div>
</section>
<input type="hidden" name="DynamicContent[apply_if_params]" id="apply_if_params">
<?php
BackendWidget::begin(['title' => Yii::t('app', 'Match settings'), 'icon' => 'cogs', 'footer' => $this->blocks['submit']]);
?>
<div id="properties">
<?php
$url = Url::to(['/shop/backend-category/autocomplete']);
$category = $model->apply_if_last_category_id > 0 ? \app\modules\shop\models\Category::findById($model->apply_if_last_category_id) : null;
?>
<?php
echo $form->field($model, 'apply_if_last_category_id')->widget(Select2::classname(), ['options' => ['placeholder' => 'Search for a category ...'], 'pluginOptions' => ['allowClear' => true, 'ajax' => ['url' => $url, 'dataType' => 'json', 'data' => new JsExpression('function(term,page) { return {search:term}; }'), 'results' => new JsExpression('function(data,page) { return {results:data.results}; }')]], 'initValueText' => !is_null($category) ? $category->name : '']);
?>
<div class="row">
<div class="col-md-10 col-md-offset-2">
<a href="#" class="btn btn-md btn-primary add-property">
<?php
echo Icon::show('plus');
?>
示例4: function
<?php
use app\backend\widgets\BackendWidget;
use app\components\Helper;
use yii\helpers\Html;
/**
* @var \yii\web\View $this
* @var \app\modules\shop\models\Contragent $model
*/
$this->title = Yii::t('app', 'Contragent edit');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Contragents'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$form = \yii\bootstrap\ActiveForm::begin(['id' => 'contragent-form', 'action' => \yii\helpers\Url::toRoute(['create', 'customer' => $model->customer_id]), 'layout' => 'horizontal']);
BackendWidget::begin(['icon' => 'user', 'title' => Yii::t('app', 'Contragent edit'), 'footer' => \yii\helpers\Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-success'])]);
$_jsTemplateResultFunc = <<<'JSCODE'
function (data) {
if (data.loading) return data.text;
var tpl = '<div class="s2contragent-result">' +
'<strong>' + (data.first_name || '') + ' ' + (data.middle_name || '') + ' ' + (data.last_name || '') + ' ' + '</strong>' +
'<div>' + (data.email || '') + ' (' + (data.phone || '') + ')</div>' +
'</div>';
return tpl;
}
JSCODE;
echo \app\backend\widgets\Select2Ajax::widget(['initialData' => [$model->customer_id => null !== $model->customer ? $model->customer->first_name : 'Guest'], 'model' => $model, 'modelAttribute' => 'customer_id', 'form' => $form, 'multiple' => false, 'searchUrl' => \yii\helpers\Url::toRoute(['ajax-customer']), 'pluginOptions' => ['allowClear' => false, 'escapeMarkup' => new \yii\web\JsExpression('function (markup) {return markup;}'), 'templateResult' => new \yii\web\JsExpression($_jsTemplateResultFunc), 'templateSelection' => new \yii\web\JsExpression('function (data) {return data.first_name || data.text;}')]]);
echo \app\modules\shop\widgets\Contragent::widget(['viewFile' => 'contragent/inherit_form', 'model' => $model, 'form' => $form, 'additional' => ['hideHeader' => true]]);
BackendWidget::end();
$form->end();
示例5:
<?php
echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-success']);
?>
</div>
<?php
$this->endBlock('submit');
?>
<div class="row">
<div class="col-md-4" id="jstree-more">
<?php
$form = ActiveForm::begin(['id' => 'newsletter_config', 'type' => ActiveForm::TYPE_VERTICAL, 'method' => 'get']);
?>
<?php
BackendWidget::begin(['title' => Yii::t('app', 'Newsletter config'), 'icon' => 'cogs', 'footer' => $this->blocks['submit']]);
?>
<?php
echo $form->field($model, 'isActive')->textInput()->widget(\kartik\widgets\SwitchInput::className());
?>
<?php
BackendWidget::end();
?>
<?php
ActiveForm::end();
?>
</div>
</div>
示例6:
</article>
<?php
ActiveForm::end();
?>
<?php
if (!$model->isNewRecord) {
?>
<?php
$form = ActiveForm::begin(['id' => 'wareHouseOpeningHours', 'type' => ActiveForm::TYPE_HORIZONTAL]);
?>
<article class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<?php
BackendWidget::begin(['title' => Yii::t('app', 'Warehouse Opening Hours'), 'icon' => 'cubes', 'footer' => $this->blocks['submit']]);
?>
<?php
echo $form->field($wareHouseOpeningHours, 'opens');
?>
<?php
echo $form->field($wareHouseOpeningHours, 'closes');
?>
<?php
echo $form->field($wareHouseOpeningHours, 'break_from');
?>
<?php
echo $form->field($wareHouseOpeningHours, 'break_to');
?>
示例7:
<?php
echo $form->field($model, 'depended_property_values');
?>
<?php
echo $form->field($model, 'depends_on_category_group_id');
?>
<?php
echo $form->field($model, 'dont_filter')->checkbox();
?>
<?php
BackendWidget::end();
?>
<?php
BackendWidget::begin(['title' => Yii::t('app', 'Images'), 'icon' => 'image', 'footer' => $this->blocks['submit']]);
?>
<div id="actions">
<?php
echo \yii\helpers\Html::tag('span', Icon::show('plus') . Yii::t('app', 'Add files..'), ['class' => 'btn btn-success fileinput-button']);
?>
<?php
if (Yii::$app->getModule('elfinder')) {
echo \DotPlant\ElFinder\widgets\ElfinderFileInput::widget(['url' => Url::toRoute(['addImage', 'objId' => $object->id, 'objModelId' => $model->id])]);
}
?>
</div>
<?php
echo \app\modules\image\widgets\ImageDropzone::widget(['name' => 'file', 'url' => ['/shop/backend-product/upload'], 'removeUrl' => ['/shop/backend-product/remove'], 'uploadDir' => '/theme/resources/product-images', 'sortable' => true, 'sortableOptions' => ['items' => '.dz-image-preview'], 'objectId' => $object->id, 'modelId' => $model->id, 'htmlOptions' => ['class' => 'table table-striped files', 'id' => 'previews'], 'options' => ['clickable' => ".fileinput-button"]]);
示例8:
<?php
use app\backend\widgets\BackendWidget;
use yii\helpers\Html;
/**
* @var \yii\web\View $this
* @var \app\modules\shop\models\Order $model
*/
$this->title = Yii::t('app', 'New order');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Orders'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$form = \kartik\widgets\ActiveForm::begin(['method' => 'post', 'type' => \kartik\form\ActiveForm::TYPE_HORIZONTAL, 'options' => ['class' => 'form-order-backend-create']]);
BackendWidget::begin(['icon' => 'info-circle', 'title' => Yii::t('app', 'Order information'), 'footer' => Html::submitButton(Yii::t('app', 'Create'), ['class' => 'btn btn-success'])]);
?>
<div class="row">
<div class="col-md-4">
<?php
$_jsTemplateResultFunc = <<<'JSCODE'
function (data) {
if (data.loading) return data.text;
var tpl = '<div class="s2customer-result">' +
'<strong>' + (data.username || '') + '</strong>' +
'<div>' + (data.first_name || '') + ' ' + (data.last_name || '') + ' (' + (data.email || '') + ')</div>' +
'</div>';
return tpl;
}
JSCODE;
echo \app\backend\widgets\Select2Ajax::widget(['form' => $form, 'model' => $model, 'modelAttribute' => 'user_id', 'initialData' => [$model->user_id => null !== $model->user ? $model->user->username : 'Guest'], 'multiple' => false, 'searchUrl' => \yii\helpers\Url::toRoute(['ajax-user']), 'pluginOptions' => ['allowClear' => false, 'escapeMarkup' => new \yii\web\JsExpression('function (markup) {return markup;}'), 'templateResult' => new \yii\web\JsExpression($_jsTemplateResultFunc), 'templateSelection' => new \yii\web\JsExpression('function (data) {return data.username || data.text;}')]]);
echo Html::tag('div', Html::a(Yii::t('app', 'Clear'), '#clear', ['data-sel' => 'order-user_id', 'class' => 'col-md-offset-2']));
?>
示例9:
</div>
<?php
echo \app\modules\image\widgets\ImageDropzone::widget(['name' => 'file', 'url' => ['upload'], 'removeUrl' => ['remove'], 'uploadDir' => '/theme/resources/product-images', 'sortable' => true, 'sortableOptions' => ['items' => '.dz-image-preview'], 'objectId' => $object->id, 'modelId' => $model->id, 'htmlOptions' => ['class' => 'table table-striped files', 'id' => 'previews'], 'options' => ['clickable' => ".fileinput-button"]]);
?>
<?php
BackendWidget::end();
?>
</article>
<article class="<?php
echo Helper::getBackendGridClass('page', PageModule::BACKEND_PAGE_GRID, 2);
?>
">
<?php
BackendWidget::begin(['title' => Yii::t('app', 'SEO'), 'icon' => 'search', 'footer' => $this->blocks['submit']]);
?>
<?php
echo $form->field($model, 'slug', ['makeSlug' => ["#page-title", "#page-h1", "#page-breadcrumbs_label"]]);
?>
<?php
echo $form->field($model, 'slug_absolute')->checkbox();
?>
<?php
echo $form->field($model, 'subdomain');
?>
<?php
echo $form->field($model, 'h1', ['copyFrom' => ["#page-title", "#page-breadcrumbs_label"]]);
?>
示例10: foreach
}
echo Tabs::widget(['items' => [['label' => Yii::t('app', 'necessary'), 'content' => $necessaryContent], ['label' => Yii::t('app', 'unnecessary'), 'content' => $unnecessaryContent]]]);
BackendWidget::end();
}
?>
</div>
<div class="col-md-6 col-sm-12">
<h2><?php
echo Yii::t('app', 'Add new component');
?>
</h2>
<?php
foreach ($model['defaultComponents'] as $componentName => $componentConf) {
BackendWidget::begin(['id' => $componentName, 'title' => Yii::t('app', $componentName), 'options' => ['class' => 'visible-header']]);
$necessaryContent = $form->field($model, "defaultComponents[{$componentName}][name]")->label('name');
foreach ($componentConf['necessary'] as $necessaryConfName => $necessaryConfVal) {
$content = $form->field($model, "defaultComponents[{$componentName}][necessary][{$necessaryConfName}]")->label($necessaryConfName);
if (is_bool($necessaryConfVal) === true || $necessaryConfName === 'active') {
$content = $content->widget(\kartik\widgets\SwitchInput::className());
}
$necessaryContent .= $content;
}
$unnecessaryContent = '';
foreach ($componentConf['unnecessary'] as $unnecessaryConfName => $unnecessaryConfVal) {
$unnecessaryContent .= $form->field($model, "defaultComponents[{$componentName}][unnecessary][{$unnecessaryConfName}]")->label($unnecessaryConfName);
}
echo Tabs::widget(['items' => [['label' => Yii::t('app', 'necessary'), 'content' => $necessaryContent], ['label' => Yii::t('app', 'unnecessary'), 'content' => $unnecessaryContent]]]);
BackendWidget::end();
}
示例11:
* @var array $events
*/
use app\backend\widgets\BackendWidget;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
$this->title = Yii::t('app', 'Edit order stage');
$this->params['breadcrumbs'] = [['label' => Yii::t('app', 'Order stage subsystem'), 'url' => Url::to(['index'])], ['label' => Yii::t('app', 'Order stages'), 'url' => Url::to(['stage-index'])], $this->title];
?>
<?php
echo app\widgets\Alert::widget(['id' => 'alert']);
?>
<?php
$form = ActiveForm::begin(['id' => 'shop-stage-create', 'layout' => 'horizontal']);
BackendWidget::begin(['title' => Yii::t('app', 'Edit order stage'), 'icon' => 'cogs', 'footer' => \yii\helpers\Html::submitButton(Yii::t('app', 'Submit'), ['class' => 'btn btn-success'])]);
?>
<?php
echo $form->field($model, 'name');
?>
<?php
echo $form->field($model, 'name_frontend');
?>
<?php
echo $form->field($model, 'name_short');
?>
<?php
echo $form->field($model, 'event_name')->dropDownList($events);
?>
<?php
示例12:
<?php
$form = ActiveForm::begin(['id' => 'form-form', 'type' => ActiveForm::TYPE_HORIZONTAL]);
?>
<?php
$this->beginBlock('submit');
echo \app\backend\components\Helper::saveButtons($submission);
$this->endBlock();
?>
<section id="widget-grid">
<div class="row">
<article class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<?php
BackendWidget::begin(['title' => Yii::t('app', 'Submission details'), 'icon' => 'cogs', 'footer' => $this->blocks['submit']]);
?>
<?php
echo $form->field($submission, 'date_received');
?>
<?php
echo $form->field($submission, 'ip');
?>
<?php
echo $form->field($submission, 'user_agent');
?>
<?php
BackendWidget::end();
示例13:
echo $form->field($model, 'subject_template');
?>
<?php
echo $form->field($model, 'form_open_analytics_action_id');
?>
<?php
echo $form->field($model, 'form_submit_analytics_action_id');
?>
<?php
BackendWidget::end();
?>
</article>
<article class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<?php
BackendWidget::begin(['title' => Yii::t('app', 'Property Groups'), 'icon' => 'cubes', 'footer' => $this->blocks['submit']]);
?>
<?php
echo $form->field($model, 'properties')->widget('app\\widgets\\MultiSelect', ['defaultLabel' => Yii::t('app', 'Choose item'), 'items' => $items, 'selectedItems' => $selected, 'sortable' => false, 'ajax' => false]);
?>
<?php
BackendWidget::end();
?>
</article>
</div>
</section>
<?php
示例14:
<?php
echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go back'), ['class' => 'btn btn-warning', 'name' => 'action', 'value' => 'back']);
?>
<?php
echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'save']);
$this->endBlock('submit');
?>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<?php
$form = ActiveForm::begin();
?>
<?php
BackendWidget::begin(['icon' => 'usd', 'title' => Yii::t('app', 'Payment Type'), 'footer' => $this->blocks['submit']]);
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => 255]);
?>
<?php
echo $form->field($model, 'class')->textInput(['maxlength' => 255]);
?>
<?php
echo $form->field($model, 'params')->widget(\devgroup\jsoneditor\Jsoneditor::className(), ['editorOptions' => ['modes' => ['code', 'tree'], 'mode' => 'tree', 'editable' => new \yii\web\JsExpression('function(node) {
return {
field : false,
value : true
};
}
')]]);
示例15:
<?php
/** @var \app\modules\config\models\Configurable $configurable */
/** @var \app\backend\components\ActiveForm $form */
/** @var \app\modules\shop\models\ConfigConfigurableModel $model */
use app\backend\widgets\BackendWidget;
?>
<div class="row">
<div class="col-md-6 col-sm-12">
<?php
BackendWidget::begin(['title' => Yii::t('app', 'Main settings'), 'options' => ['class' => 'visible-header']]);
?>
<?php
echo $form->field($model, 'exportDirPath');
?>
<?php
echo $form->field($model, 'importDirPath');
?>
<?php
echo $form->field($model, 'defaultType')->dropDownList(\app\modules\data\models\ImportModel::knownTypes());
?>
<?php
BackendWidget::end();
?>
</div>
</div>