Beispiel #1
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use star\system\models\Tree;
/* @var $this yii\web\View */
/* @var $model star\catalog\models\ItemProp */
/* @var $form yii\widgets\ActiveForm */
list($path, $url) = Yii::$app->assetManager->publish('@star/catalog/assets');
$this->registerJsFile($url . '/js/dynoTable.js', ['depends' => [\core\assets\AppAsset::className()]]);
?>
<div class="content-body">
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">

            <?php 
$form = ActiveForm::begin();
?>

            <?php 
echo $form->field($model, 'category_id')->dropDownList(Tree::getTreesByName('商品分类'));
?>

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

            <?php 
echo $form->field($model, 'prop_alias')->textInput(['maxlength' => 100]);
?>
Beispiel #2
0
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use star\system\models\Tree;
use yii\bootstrap\Tabs;
use mihaildev\ckeditor\CKEditor;
use yii\helpers\Url;
use kartik\file\FileInput;
use star\catalog\models\Language;
use star\catalog\models\Currency;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model star\catalog\models\Item */
/* @var $form yii\widgets\ActiveForm */
list($path, $url) = Yii::$app->assetManager->publish('@star/catalog/assets/js');
$this->registerJsFile($url . '/skus.js', ['depends' => [\core\assets\AppAsset::className()]]);
?>

<div class="item-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
$fieldGroups = [];
$fields = [];
$fields[] = $form->field($model, 'title')->textInput(['maxlength' => 255]);
$fields[] = $form->field($model, 'price')->textInput(['maxlength' => 255]);
$currency = Currency::find()->all();
$fields[] = $form->field($model, 'currency')->dropDownList(ArrayHelper::map($currency, 'currency_id', 'name'));
$language = Language::find()->all();
$fields[] = $form->field($model, 'language')->dropDownList(ArrayHelper::map($language, 'language_id', 'name'));
$fieldGroups[] = ['label' => Yii::t('catalog', 'Base Info'), 'content' => implode('', $fields)];