本文整理汇总了PHP中app\models\Category::getHierarchy方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getHierarchy方法的具体用法?PHP Category::getHierarchy怎么用?PHP Category::getHierarchy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Category
的用法示例。
在下文中一共展示了Category::getHierarchy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<div class="tab-pane active" id="home">
<p>
<?php
echo $form->field($model, 'type_id')->radioList(['1' => Yii::t('app', 'Revenue'), '2' => Yii::t('app', 'Expense')], ['itemOptions' => ['class' => 'radio-inline', 'labelOptions' => array('style' => 'padding:4px;')]])->label('');
?>
<?php
echo DatePicker::widget(['model' => $model, 'form' => $form, 'attribute' => 'date', 'type' => DatePicker::TYPE_INPUT, 'size' => 'sm', 'pluginOptions' => ['autoclose' => true, 'todayHighlight' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'value')->widget(MaskMoney::classname(), ['pluginOptions' => ['affixesStay' => true, 'precision' => 2, 'allowZero' => true, 'allowNegative' => true]]);
?>
<?php
echo $form->field($model, 'category_id', ['inputOptions' => ['class' => 'selectpicker ']])->dropDownList(app\models\Category::getHierarchy(), ['prompt' => Yii::t('app', 'Select'), 'class' => 'form-control required']);
?>
<?php
echo $form->field($model, 'description')->textInput(['maxlength' => 100]);
?>
</div>
<div class="tab-pane" id="profile">
<?php
echo $form->field($model, 'is_pending')->checkbox(['label' => '', 'labelOptions' => array('class' => 'col-lg-2 control-label')])->label(Yii::t('app', 'Pending'));
?>
<?php
echo $form->field($model, 'file')->fileInput();
示例2:
<div class="row">
<div class="col-sm-11">
<?php
echo '<label class="control-label">' . Yii::t('app', 'To') . '</label>';
echo DatePicker::widget(['model' => $model, 'attribute' => 'end_date', 'type' => DatePicker::TYPE_COMPONENT_PREPEND, 'options' => ['placeholder' => ''], 'pluginOptions' => ['autoclose' => true, 'todayHighlight' => true, 'format' => 'yyyy-mm-dd']]);
?>
</div>
</div><p>
<?php
echo $form->field($model, 'type_id')->dropDownList(['1' => Yii::t('app', 'Revenue'), '2' => Yii::t('app', 'Expense')], ['prompt' => Yii::t('app', 'All')]);
//->dropDownList(ArrayHelper::map(Type::find()->all(), 'id_type', 'desc_type'),['prompt'=>Yii::t('app', 'All')])
?>
<?php
echo $form->field($model, 'category_id')->dropDownList(Category::getHierarchy(), ['prompt' => Yii::t('app', 'All')]);
?>
<?php
echo $form->field($model, 'value');
?>
<?php
echo $form->field($model, 'description');
?>
<?php
echo $form->field($model, 'is_pending')->checkbox();
?>
<div class="form-group">