本文整理汇总了PHP中kalibao\common\components\i18n\I18N类的典型用法代码示例。如果您正苦于以下问题:PHP I18N类的具体用法?PHP I18N怎么用?PHP I18N使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了I18N类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'third_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'third.id']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->third_id) ? Third::findOne(['id' => $models['main']->third_id])->id : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'first_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('first_name')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'last_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('last_name')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'email', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('email')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'default_language', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'language_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->default_language) ? LanguageI18n::findOne(['language_id' => $models['main']->default_language, 'i18n_id' => $language])->title : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'user_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'user.username']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->user_id) ? User::findOne(['id' => $models['main']->user_id])->username : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'gender_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'person_gender_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->gender_id) ? PersonGenderI18n::findOne(['gender_id' => $models['main']->gender_id, 'i18n_id' => $language])->title : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'phone_1', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('phone_1')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'phone_2', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('phone_2')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'fax', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('fax')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'website', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('website')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'birthday', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm date-picker date-range', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('birthday')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'skype', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('skype')]]);
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
$this->setItems($items);
}
开发者ID:kalibao,项目名称:magesko,代码行数:33,代码来源:ListGridRowEdit.php
示例2: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// set titles
$this->setCreateTitle(Yii::t('kalibao.backend', 'cms_news_create_title'));
$this->setUpdateTitle(Yii::t('kalibao.backend', 'cms_news_update_title'));
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
}
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('title')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'cms_news_group_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'cms_news_group_i18n.title']), 'data-add-action' => Url::to('/cms/cms-news-group/create'), 'data-update-action' => Url::to('/cms/cms-news-group/update'), 'data-update-argument' => 'id', 'data-related-field' => '.link_cms_news_group_title', 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->cms_news_group_id) ? CmsNewsGroupI18n::findOne(['cms_news_group_id' => $models['main']->cms_news_group_id, 'i18n_id' => $language])->title : '']]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'content', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-filebrowser-browse-url' => Url::to(['cms-image/list', 'mode' => 'explorer']), 'data-ckeditor-language' => $language]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'activated', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'published_at', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm date-picker date-range', 'value' => $models['main']->published_at != '' ? Yii::$app->formatter->asDatetime($models['main']->published_at, 'yyyy-MM-dd') : '', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('published_at')]]);
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
}
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
}
$this->setItems($items);
}
开发者ID:kalibao,项目名称:kalibao-framework,代码行数:35,代码来源:Edit.php
示例3: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// set titles
$this->setCreateTitle(Yii::t('kalibao', 'create_title'));
$this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'company_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'company.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->company_id) ? Company::findOne(['third_id' => $models['main']->company_id])->name : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'person_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'person.last_name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->person_id) ? Person::findOne(['third_id' => $models['main']->person_id])->last_name : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'is_primary', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
}
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
}
$this->setItems($items);
}
开发者ID:kalibao,项目名称:magesko,代码行数:30,代码来源:Edit.php
示例4: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// set titles
$this->setCreateTitle(Yii::t('kalibao.backend', 'rbac_permission_create_title'));
$this->setUpdateTitle(Yii::t('kalibao.backend', 'rbac_permission_update_title'));
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
}
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('name')]]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('title')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'rule_path', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('rule_path')]]);
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
}
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
}
$this->setItems($items);
}
开发者ID:kalibao,项目名称:kalibao-framework,代码行数:33,代码来源:Edit.php
示例5: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// set titles
$this->setCreateTitle(Yii::t('kalibao.backend', 'variable_variable_create_title'));
$this->setUpdateTitle(Yii::t('kalibao.backend', 'variable_variable_update_title'));
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
}
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'variable_group_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'variable_group_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-add-action' => Url::to('/variable/variable-group/create'), 'data-update-action' => Url::to('/variable/variable-group/update'), 'data-update-argument' => 'id', 'data-related-field' => '.link_variable_group_title', 'data-text' => !empty($models['main']->variable_group_id) ? VariableGroupI18n::findOne(['variable_group_id' => $models['main']->variable_group_id, 'i18n_id' => $language])->title : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('name')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'val', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('val')]]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm', 'data-ckeditor-language' => $language]]);
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
}
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
}
$this->setItems($items);
}
开发者ID:kalibao,项目名称:kalibao-framework,代码行数:34,代码来源:Edit.php
示例6: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
/*$items[] = new InputField([
'model' => $models['i18n'],
'attribute' => 'gender_id',
'type' => 'activeTextInput',
'options' => [
'class' => 'form-control input-sm',
'maxlength' => true,
'placeholder' => $models['i18n']->getAttributeLabel('gender_id'),
]
]);*/
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('title')]]);
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
$this->setItems($items);
}
开发者ID:kalibao,项目名称:magesko,代码行数:32,代码来源:ListGridRowEdit.php
示例7: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// set titles
$this->setCreateTitle(Yii::t('kalibao', 'create_title'));
$this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
}
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'file', 'type' => 'activeFileInput', 'options' => ['maxlength' => true, 'class' => 'input-advanced-uploader', 'placeholder' => $models['main']->getAttributeLabel('file'), 'data-type-uploader' => $uploadConfig['main']['file']['type'], 'data-file-url' => $models['main']->file != '' ? $uploadConfig['main']['file']['baseUrl'] . '/' . $models['main']->file : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'media_type_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'media_type_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->media_type_id) ? MediaTypeI18n::findOne(['media_type_id' => $models['main']->media_type_id, 'i18n_id' => $language])->title : '']]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('title')]]);
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
}
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
}
$this->setItems($items);
}
开发者ID:kalibao,项目名称:magesko,代码行数:33,代码来源:Edit.php
示例8: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
if (!$models['main']->isNewRecord) {
$items['id'] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
}
$items['exclude_discount_code'] = new InputField(['model' => $models['main'], 'attribute' => 'exclude_discount_code', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items['force_secure'] = new InputField(['model' => $models['main'], 'attribute' => 'force_secure', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items['archived'] = new InputField(['model' => $models['main'], 'attribute' => 'archived', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items['top_product'] = new InputField(['model' => $models['main'], 'attribute' => 'top_product', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items['exclude_from_google'] = new InputField(['model' => $models['main'], 'attribute' => 'exclude_from_google', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items['link_brand_product'] = new InputField(['model' => $models['main'], 'attribute' => 'link_brand_product', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('link_brand_product')]]);
$items['link_product_test'] = new InputField(['model' => $models['main'], 'attribute' => 'link_product_test', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('link_product_test')]]);
$items['available'] = new InputField(['model' => $models['main'], 'attribute' => 'available', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items['available_date'] = new InputField(['model' => $models['main'], 'attribute' => 'available_date', 'type' => 'activeTextInput', 'required' => true, 'options' => ['class' => 'form-control input-sm date-picker date-range required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('available_date')]]);
$items['alternative_product'] = new InputField(['model' => $models['main'], 'attribute' => 'alternative_product', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'product_i18n.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->alternative_product) ? ProductI18n::findOne(['product_id' => $models['main']->alternative_product, 'i18n_id' => $language])->name : '']]);
$items['lidoli_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'lidoli_category_id', 'type' => 'activeTextInput', 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('lidoli_category_id')]]);
$items['brand_id'] = new InputField(['model' => $models['main'], 'attribute' => 'brand_id', 'type' => 'activeHiddenInput', 'required' => true, 'options' => ['class' => 'form-control input-sm input-ajax-select required', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'brand.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->brand_id) ? Brand::findOne(['id' => $models['main']->brand_id])->name : '']]);
$items['supplier_id'] = new InputField(['model' => $models['main'], 'attribute' => 'supplier_id', 'type' => 'activeHiddenInput', 'required' => true, 'options' => ['class' => 'form-control input-sm input-ajax-select required', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'supplier.name']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->supplier_id) ? Supplier::findOne(['id' => $models['main']->supplier_id])->name : '']]);
$items['catalog_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'catalog_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('catalog_category_id')]]);
$items['google_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'google_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('google_category_id')]]);
$items['stats_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'stats_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('stats_category_id')]]);
$items['accountant_category_id'] = new InputField(['model' => $models['main'], 'attribute' => 'accountant_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('category_i18n.title'), 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('accountant_category_id')]]);
$items['base_price'] = new InputField(['model' => $models['main'], 'attribute' => 'base_price', 'type' => 'activeTextInput', 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('base_price'), 'id' => 'base_price']]);
$items['is_pack'] = new InputField(['model' => $models['main'], 'attribute' => 'is_pack', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items['short_description'] = new InputField(['model' => $models['i18n'], 'attribute' => 'short_description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
$items['long_description'] = new InputField(['model' => $models['i18n'], 'attribute' => 'long_description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
$items['comment'] = new InputField(['model' => $models['i18n'], 'attribute' => 'comment', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
$items['page_title'] = new InputField(['model' => $models['i18n'], 'attribute' => 'page_title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('page_title')]]);
$items['name'] = new InputField(['model' => $models['i18n'], 'attribute' => 'name', 'type' => 'activeTextInput', 'required' => true, 'options' => ['class' => 'form-control input-sm required', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('name')]]);
$items['infos_shipping'] = new InputField(['model' => $models['i18n'], 'attribute' => 'infos_shipping', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
$items['meta_description'] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm', 'placeholder' => $models['i18n']->getAttributeLabel('meta_description')]]);
$items['meta_keywords'] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_keywords', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('meta_keywords')]]);
if (!$models['main']->isNewRecord) {
$items['created_at'] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
}
if (!$models['main']->isNewRecord) {
$items['updated_at'] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
}
$this->setItems($items);
}
开发者ID:kalibao,项目名称:magesko,代码行数:54,代码来源:View.php
示例9: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// set titles
$this->setCreateTitle(Yii::t('kalibao', 'create_title'));
$this->setUpdateTitle(Yii::t('kalibao', 'update_title'));
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
}
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'branch_type_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'branch_type_i18n.label']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->branch_type_id) ? BranchTypeI18n::findOne(['branch_type_id' => $models['main']->branch_type_id, 'i18n_id' => $language])->label : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'tree_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'tree_i18n.label']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->tree_id) ? TreeI18n::findOne(['tree_id' => $models['main']->tree_id, 'i18n_id' => $language])->label : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'parent', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'branch_i18n.label']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->parent) ? BranchI18n::findOne(['branch_id' => $models['main']->parent, 'i18n_id' => $language])->label : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'order', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('order')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'media_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'media_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->media_id) ? MediaI18n::findOne(['media_id' => $models['main']->media_id, 'i18n_id' => $language])->title : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'visible', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'background', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('background')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'presentation_type', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'offset', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('offset')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'display_brands_types', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'big_menu_only_first_level', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'unfold', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'google_shopping_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('google_shopping_category.id'), 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('google_shopping_category_id')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'google_shopping', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'affiliation_category_id', 'type' => 'activeDropDownList', 'data' => $dropDownList('affiliation_category.id'), 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('affiliation_category_id')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'affiliation', 'type' => 'activeCheckbox', 'options' => ['class' => '', 'label' => '']]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'label', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('label')]]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm wysiwyg-textarea', 'data-ckeditor-language' => $language]]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'url', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('url')]]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_title', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('meta_title')]]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_description', 'type' => 'activeTextarea', 'options' => ['class' => 'form-control input-sm', 'placeholder' => $models['i18n']->getAttributeLabel('meta_description')]]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'meta_keywords', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('meta_keywords')]]);
$items[] = new InputField(['model' => $models['i18n'], 'attribute' => 'h1_tag', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['i18n']->getAttributeLabel('h1_tag')]]);
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
}
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
}
$this->setItems($items);
}
开发者ID:kalibao,项目名称:magesko,代码行数:53,代码来源:Edit.php
示例10: run
/**
* @inheritdoc
*/
public function run()
{
// get app language of current application
$languages = Yii::$app->appLanguage->getAppLanguages();
$languageLabels = [];
foreach ($languages as $languageId) {
$languageLabels[$languageId] = I18N::label($languageId);
}
// build form
$html = '<form method="post" class="current-language" action="' . Yii::$app->request->url . '">';
$html .= Html::dropDownList('language', Yii::$app->language, $languageLabels, ['class' => 'language-selector form-control']);
foreach ($languages as $languageId) {
$html .= Html::hiddenInput($languageId, Url::to([''] + array_merge(Yii::$app->request->get(), ['language' => $languageId])));
}
$html .= '</form>';
return $html;
}
开发者ID:kalibao,项目名称:kalibao-framework,代码行数:20,代码来源:LanguageMenuWidget.php
示例11: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// set titles
$this->setCreateTitle(Yii::t('kalibao.backend', 'rbac_user_create_title'));
$this->setUpdateTitle(Yii::t('kalibao.backend', 'rbac_user_update_title'));
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'third_id', 'value' => $models['main']->third_id]);
}
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'first_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('first_name')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'last_name', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('last_name')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'email', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('email')]]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'default_language', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'language_i18n.title']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->default_language) ? LanguageI18n::findOne(['language_id' => $models['main']->default_language, 'i18n_id' => $language])->title : '']]);
$items[] = new InputField(['model' => $models['user'], 'attribute' => 'password', 'type' => 'activePasswordInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['user']->getAttributeLabel('password')]]);
$items[] = new InputField(['model' => $models['user'], 'attribute' => 'password_repeat', 'type' => 'activePasswordInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['user']->getAttributeLabel('password_repeat')]]);
$items[] = new InputField(['model' => $models['user'], 'attribute' => 'status', 'type' => 'activeDropDownList', 'data' => $dropDownList('user.status:required'), 'options' => ['class' => 'form-control input-sm']]);
$items[] = new InputField(['model' => $models['user'], 'attribute' => 'active_password_reset', 'type' => 'activeCheckbox', 'options' => ['label' => '']]);
if (!empty($models['rbacRoles'])) {
$rbacRoles = [];
foreach ($models['rbacRoles'] as $rbacRole) {
$rbacRoles[$rbacRole->id] = $rbacRole->rbacRoleI18ns[0]->title;
}
$rbacUserRoles = [];
foreach ($models['rbacUserRoles'] as $rbacUserRole) {
$rbacUserRoles[] = $rbacUserRole->rbac_role_id;
}
$items[] = new SimpleValueField(['label' => Yii::t('kalibao.backend', 'person_user_roles'), 'value' => Html::checkboxList('rbacUserRolesId', $rbacUserRoles, $rbacRoles, ['unselect' => '-1'])]);
}
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
}
if (!$models['main']->isNewRecord) {
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
}
$this->setItems($items);
}
开发者ID:kalibao,项目名称:magesko,代码行数:49,代码来源:Edit.php
示例12: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// models
$models = $this->getModels();
// language
$language = $this->getLanguage();
// get drop down list methods
$dropDownList = $this->getDropDownList();
// upload config
$uploadConfig['main'] = $this->uploadConfig[(new \ReflectionClass($models['main']))->getName()];
// set items
$items = [];
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'id', 'value' => $models['main']->id]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'sheet_type_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'sheet_type_i18n.label']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->sheet_type_id) ? SheetTypeI18n::findOne(['sheet_type_id' => $models['main']->sheet_type_id, 'i18n_id' => $language])->label : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'branch_id', 'type' => 'activeHiddenInput', 'options' => ['class' => 'form-control input-sm input-ajax-select', 'data-action' => Url::to(['advanced-drop-down-list', 'id' => 'branch_i18n.label']), 'data-allow-clear' => 1, 'data-placeholder' => Yii::t('kalibao', 'input_select'), 'data-text' => !empty($models['main']->branch_id) ? BranchI18n::findOne(['branch_id' => $models['main']->branch_id, 'i18n_id' => $language])->label : '']]);
$items[] = new InputField(['model' => $models['main'], 'attribute' => 'primary_key', 'type' => 'activeTextInput', 'options' => ['class' => 'form-control input-sm', 'maxlength' => true, 'placeholder' => $models['main']->getAttributeLabel('primary_key')]]);
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'created_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->created_at, I18N::getDateFormat())]);
$items[] = new SimpleValueField(['model' => $models['main'], 'attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDatetime($models['main']->updated_at, I18N::getDateFormat())]);
$this->setItems($items);
}
开发者ID:kalibao,项目名称:magesko,代码行数:24,代码来源:ListGridRowEdit.php
-
The BolunHan/Krypton repository through 2021-06-03 on GitHub allows absolute pat
阅读:678|2022-07-29
-
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1218|2022-08-30
-
ozzieperez/packtpub-library-downloader: Script to download all your PacktPub ebo
阅读:530|2022-08-15
-
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1130|2022-08-17
-
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:938|2022-11-06
-
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1334|2022-08-18
-
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:484|2022-08-16
-
PacktPublishing/Mastering-Embedded-Linux-Programming-Third-Edition: Mastering Em
阅读:744|2022-08-15
-
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:636|2022-11-06
-
shem8/MaterialLogin: Login view with material design
阅读:725|2022-08-17
|
请发表评论