當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Category::getList方法代碼示例

本文整理匯總了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]) */
開發者ID:Sywooch,項目名稱:armin,代碼行數:31,代碼來源:_form.php

示例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 
開發者ID:phpsong,項目名稱:ExtJS5-Yii2,代碼行數:31,代碼來源:_form.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()]);
 }
開發者ID:BoBRoID,項目名稱:plochadka,代碼行數:12,代碼來源:SiteController.php

示例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();
開發者ID:BoBRoID,項目名稱:plochadka,代碼行數:10,代碼來源:post_edit.php

示例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()]);
     }
 }
開發者ID:BoBRoID,項目名稱:plochadka,代碼行數:16,代碼來源:SiteController.php


注:本文中的common\models\Category::getList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。