本文整理汇总了PHP中common\models\Category::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getList方法的具体用法?PHP Category::getList怎么用?PHP Category::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\Category
的用法示例。
在下文中一共展示了Category::getList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
echo $form->field($model, 'complect', ['options' => ['class' => '']])->textarea(['rows' => 1]);
?>
<?php
echo $form->field($model, 'description', ['options' => ['class' => '']])->textarea(['rows' => 1]);
?>
<?php
echo $form->field($model, 'characteristics', ['options' => ['class' => '']])->textarea(['rows' => 1]);
?>
<?php
echo $form->field($model, 'doc_links', ['options' => ['class' => '']])->textarea(['rows' => 1]);
?>
</div>
<div class="form-group col-md-4">
<?php
echo $form->field($model, 'category_id', ['options' => ['class' => '']])->dropDownList(Category::getList());
?>
<?php
echo $form->field($model, 'serial', ['options' => ['class' => '']])->textInput(['maxlength' => true]);
?>
<?php
/* = $form->field($model, 'status', ['options'=>['class'=>'']])->textInput() */
?>
<?php
echo $form->field($model, 'condition', ['options' => ['class' => '']])->dropDownList(Condition::getList());
?>
<?php
echo $form->field($model, 'provided_by', ['options' => ['class' => '']])->dropDownList($providers);
?>
<?php
/* = $form->field($model, 'fixed_by', ['options'=>['class'=>'']])->textInput(['maxlength' => true]) */
示例2:
?>
<div class="part-form">
<?php
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Сохранить' : 'Изменить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary', 'onclick' => "\$('#file-input').fileinput('upload');"]);
?>
</div>
<?php
echo $form->field($model, 'category_id')->dropDownList(Category::getList());
?>
<?php
echo $form->field($model, 'file_schema')->widget(FileAPI::className(), ['settings' => ['url' => ['/part/fileapi-upload']]]);
?>
<?php
echo $form->field($model, 'file_foto')->widget(FileAPI::className(), ['settings' => ['url' => ['/part/fileapi-upload']]]);
?>
<?php
/*<?= $form->field($model, 'logo')->fileInput() ?>*/
?>
<?php
示例3: actionEditcategory
public function actionEditcategory($id)
{
$category = Category::findOne(['id' => $id]);
if (!$category) {
return $this->run('error');
}
if (\Yii::$app->request->post("Category")) {
$category->attributes = \Yii::$app->request->post("Category");
$category->save();
}
return $this->render('category_edit', ['category' => $category, 'parents' => Category::getList()]);
}
示例4:
<h1>Посты</h1>
<?php
$form = new \yii\bootstrap\ActiveForm();
$form->begin();
echo $form->field($post, 'category')->dropDownList(\common\models\Category::getList()), $form->field($post, 'premium'), $form->field($post, 'title'), $form->field($post, 'content')->textarea(), $form->field($post, 'price'), $form->field($post, 'phone'), $form->field($post, 'email');
?>
<button class="btn btn-default" type="submit">Сохранить</button>
<?php
$form->end();
示例5: actionCreatepost
public function actionCreatepost()
{
if (\Yii::$app->user->isGuest) {
return $this->run('site/login');
}
$post = new Post();
$data = \Yii::$app->request->post("Post");
if (!empty($data)) {
$post->load(\Yii::$app->request->post());
}
if (!empty($data) && $post->validate() && $post->save()) {
return $this->render('create_post_success', ['post' => $post]);
} else {
return $this->render('create_post', ['post' => $post, 'categoryList' => Category::getList()]);
}
}