本文整理匯總了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()]);
}
}