コード例 #1
0
echo $form->field(app\models\ViewObject::getByModel($model, true), 'view_id')->dropDownList(app\models\View::getAllAsArray());
?>

    <?php 
if (!$model->isNewRecord && is_array($model->relatedProductsArray)) {
    $data = \yii\helpers\ArrayHelper::map($model->relatedProducts, 'id', 'name');
    ?>
        <?php 
    echo \app\backend\widgets\Select2Ajax::widget(['initialData' => $data, 'form' => $form, 'model' => $model, 'modelAttribute' => 'relatedProductsArray', 'multiple' => true, 'searchUrl' => '/shop/backend-product/ajax-related-product', 'additional' => ['placeholder' => 'Поиск продуктов ...']]);
    ?>
    <?php 
}
?>

    <?php 
echo $form->field($model, 'measure_id')->dropDownList(\app\components\Helper::getModelMap(\app\modules\shop\models\Measure::className(), 'id', 'name'));
?>

    <?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']);
コード例 #2
0
ファイル: _config.php プロジェクト: kronos777/dotplant2
?>

        <?php 
echo $form->field($model, 'countUniqueProductsOnly')->widget(SwitchInput::className());
?>

        <?php 
echo $form->field($model, 'countChildrenProducts')->widget(SwitchInput::className());
?>

        <?php 
echo $form->field($model, 'showDeletedOrders')->widget(SwitchInput::className());
?>

        <?php 
echo $form->field($model, 'defaultMeasureId')->dropDownList(Helper::getModelMap(\app\modules\shop\models\Measure::className(), 'id', 'name'));
?>

        <?php 
echo $form->field($model, 'defaultOrderStageFilterBackend')->dropDownList([0 => ''] + Helper::getModelMap(\app\modules\shop\models\OrderStage::className(), 'id', 'name_short'));
?>

        <?php 
BackendWidget::end();
?>
    </div>
    <?php 
/**
 * @var bool Allow to add same product in the order
 */
$allowToAddSameProduct = 0;
コード例 #3
0
 public function actionIndex()
 {
     $searchModel = new SearchModel(['model' => Measure::className(), 'partialMatchAttributes' => ['name'], 'scenario' => 'default']);
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }