예제 #1
0
파일: _form.php 프로젝트: cboy868/nana
use yii\helpers\Html;
use common\components\widgets\ActiveForm;
use shop\models\Category;
/* @var $this yii\web\View */
/* @var $model shop\models\Category */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="category-form">

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

    <?php 
echo $form->field($model, 'pid')->dropDownList(Category::selTree(), ['prompt' => '顶级']);
?>

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

    <?php 
echo $form->field($model, 'cover')->fileInput();
?>

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

	<div class="form-group">
예제 #2
0
파일: _form.php 프로젝트: cboy868/nana
/* @var $model shop\models\Attr */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="attr-form">

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

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

    <?php 
echo $form->field($model, 'category_id')->dropDownList(Category::selTree());
?>

    <?php 
echo $form->field($model, 'is_multi')->radioList(['否', '是']);
?>

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

	<div class="form-group">
        <div class="col-sm-offset-2 col-sm-3">
            <?php 
echo Html::submitButton('保 存', ['class' => 'btn btn-primary btn-block']);
?>