本文整理汇总了PHP中app\models\Product::getDropdownData方法的典型用法代码示例。如果您正苦于以下问题:PHP Product::getDropdownData方法的具体用法?PHP Product::getDropdownData怎么用?PHP Product::getDropdownData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Product
的用法示例。
在下文中一共展示了Product::getDropdownData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
</div>
<?php
ActiveForm::end();
?>
</div>
<div class="receipt-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
$columns = [['attribute' => 'bukmark_code', 'label' => 'Código', 'value' => 'product.bukmark_code', 'options' => ['style' => 'width: 100px;']], ['attribute' => 'product_id', 'value' => 'product.title', 'filter' => Html::activeDropDownList($searchModel, 'product_id', Product::getDropdownData(), ['class' => 'form-control', 'prompt' => 'Elegir producto']), 'enableSorting' => false], ['label' => 'Cliente', 'value' => 'estimate.client.name', 'filter' => Html::activeDropDownList($searchModel, 'client_id', Client::getIdNameArray(), ['class' => 'form-control', 'prompt' => 'Nombre'])], ['attribute' => 'estimate.receipt.created_date', 'format' => 'date', 'filter' => false], ['attribute' => 'quantity'], ['label' => 'Total', 'value' => function ($model, $key, $index, $column) {
return Currency::format($model->quantitySubtotal, Currency::CURRENCY_ARS);
}, 'options' => ['style' => 'width: 150px;']]];
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $columns]);
?>
<?php
echo ExportMenu::widget(['dataProvider' => $exportDataProvider, 'target' => ExportMenu::TARGET_SELF, 'showConfirmAlert' => false, 'filename' => 'resumen', 'columns' => $columns]);
?>
</div>
示例2:
/* @var $model app\models\EstimateEntry */
/* @var $form yii\widgets\ActiveForm */
$currencies = Currency::labels();
$this->registerJs('var productImagesUrl = "' . Url::to(['product/get-images', 'id' => 'placeholder']) . '";', View::POS_HEAD);
$this->registerJs('var productSupplierUrl = "' . Url::to(['product/get-supplier', 'id' => 'placeholder']) . '";', View::POS_HEAD);
EstimateEntryAsset::register($this);
?>
<div class="estimate-entry-form">
<?php
$form = ActiveForm::begin(['enableClientValidation' => false]);
?>
<?php
echo $form->field($model, 'product_id')->dropDownList(Product::getDropdownData(), ['prompt' => 'Elegir producto', 'id' => 'product_id']);
?>
<?php
if ($model->isNewRecord) {
?>
<div class="form-group">
<?php
echo Html::submitButton('Crear producto', ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'add-product']);
?>
</div>
<?php
}
?>
<?php
echo $form->field($model, 'product_image_id')->hiddenInput(['id' => 'product_image_id']);