示例#1
0
 public static function getValidatorChoices()
 {
     return [self::REQUIRED_VALIDATOR => Module::t('attribute', 'Required'), self::STRING_VALIDATOR => Module::t('attribute', 'String'), self::EMAIL_VALIDATOR => Module::t('attribute', 'Email'), self::DATE_VALIDATOR => Module::t('attribute', 'Date'), self::INTEGER_VALIDATOR => Module::t('attribute', 'Integer'), self::NUMBER_VALIDATOR => Module::t('attribute', 'Number'), self::MATCH_VALIDATOR => Module::t('attribute', 'Match'), self::UNIQUE_VALIDATOR => Module::t('attribute', 'Unique')];
 }
示例#2
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('attribute', 'ID'), 'name' => Module::t('attribute', 'Name'), 'presentation' => Module::t('attribute', 'Presentation'), 'type' => Module::t('attribute', 'Type'), 'fieldConfig' => Module::t('attribute', 'Filed Config'), 'rulesConfig' => Module::t('attribute', 'Validators'), 'predefined_values' => Module::t('attribute', 'Predefined values')];
 }
示例#3
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('value', 'ID'), 'attribute_id' => Module::t('value', 'Attribute'), 'value' => Module::t('value', 'Value'), 'presentation' => Module::t('attribute', 'Presentation')];
 }
示例#4
0
<?php

use im\eav\models\Attribute;
use im\eav\Module;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $attributes im\eav\models\AttributeValue[] */
/* @var $form ActiveForm|array */
?>

<div data-cont="fields">
    <?php 
echo $this->render('@im/eav/backend/views/attribute/_fields', ['attributes' => $attributes, 'form' => $form]);
?>
</div>

<div class="form-inline">
    <?php 
echo Html::dropDownList('attributes', null, ArrayHelper::map(Attribute::find()->asArray()->orderBy('name')->all(), 'id', 'presentation'), ['class' => 'form-control', 'data-field' => 'attributes', 'multiple' => true]);
?>
    <?php 
echo Html::button(Module::t('attribute', 'Add attribute'), ['class' => 'btn btn-primary', 'data-action' => 'add']);
?>
</div>

<div data-cont="temp"></div>