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


PHP Category::className方法代碼示例

本文整理匯總了PHP中common\models\Category::className方法的典型用法代碼示例。如果您正苦於以下問題:PHP Category::className方法的具體用法?PHP Category::className怎麽用?PHP Category::className使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在common\models\Category的用法示例。


在下文中一共展示了Category::className方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCategory

 /**
  * @return static
  */
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'category_id'])->via('menuItemContent');
 }
開發者ID:czechcamus,項目名稱:dasport,代碼行數:7,代碼來源:MenuItemRecord.php

示例2: getCategories

 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['mid' => 'mid'])->where('type=:type', [':type' => Category::TYPE])->viaTable(Relationship::tableName(), ['cid' => 'cid']);
 }
開發者ID:Penton,項目名稱:MoBlog,代碼行數:4,代碼來源:Post.php

示例3: getChildren

 public function getChildren()
 {
     return $this->hasMany(Category::className(), ['parent_id' => 'id']);
 }
開發者ID:Mitonios,項目名稱:mitonios-blog,代碼行數:4,代碼來源:Category.php

示例4: getCategory

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'category_id']);
 }
開發者ID:ninetor,項目名稱:yii-classifield,代碼行數:7,代碼來源:CategoryProperty.php

示例5: actions

 /**
  * @return array
  */
 public function actions()
 {
     return ['update-cat' => ['class' => crudActionUpdate::className(), 'modelClass' => Category::className(), 'view' => 'update-cat', 'onAfterAction' => [$this, 'afterSaveCategory']], 'delete-cat' => ['class' => crudActionDelete::className(), 'modelClass' => Category::className(), 'onAfterAction' => [$this, 'afterDeleteCategory']], 'insert-product' => ['class' => crudActionCreate::className(), 'modelClass' => Product::className(), 'attributes' => ['parents' => (array) Yii::$app->getRequest()->get('cat_id')], 'view' => 'update-product', 'onAfterAction' => [$this, 'afterSaveProduct']], 'update-product' => ['class' => crudActionUpdate::className(), 'modelClass' => Product::className(), 'view' => 'update-product', 'onAfterAction' => [$this, 'afterSaveProduct']], 'delete-product' => ['class' => crudActionDelete::className(), 'modelClass' => Product::className(), 'onAfterAction' => [$this, 'afterDeleteProduct']]];
 }
開發者ID:andreykluev,項目名稱:yii2-catalog-module,代碼行數:7,代碼來源:AdminController.php

示例6: getCategories

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['parent_id' => 'cgid']);
 }
開發者ID:kangqf,項目名稱:kblog_with_yii2,代碼行數:7,代碼來源:Category.php

示例7: getCategories

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable('page_category', ['page_id' => 'id']);
 }
開發者ID:BorisMatonickin,項目名稱:yiicms,代碼行數:7,代碼來源:Page.php

示例8: getCategory

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategory()
 {
     return $this->hasMany(Category::className(), ['Id' => 'categoryId'])->via('resMaps');
 }
開發者ID:rajanishtimes,項目名稱:partnerapi,代碼行數:7,代碼來源:Restaurant.php

示例9: getNestedCategories

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getNestedCategories()
 {
     return $this->hasMany(Category::className(), ['parent_id' => 'id'])->from(['subcategory' => 'category']);
 }
開發者ID:ninetor,項目名稱:yii-classifield,代碼行數:7,代碼來源:Category.php

示例10: actions

 public function actions()
 {
     return ['sort' => ['class' => SortableGridAction::className(), 'modelName' => Category::className()]];
 }
開發者ID:daixianceng,項目名稱:xiaoego.com,代碼行數:4,代碼來源:CategoryController.php

示例11: getCategory

 public function getCategory()
 {
     return $this->hasOne(Category::className(), ["cid" => "cid"]);
 }
開發者ID:VampireMe,項目名稱:yii2test_advanced,代碼行數:4,代碼來源:Article.php

示例12: getCategories

 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(CategoryVia::tableName(), ['blog_id' => 'id']);
 }
開發者ID:bolom009,項目名稱:testwork_api,代碼行數:4,代碼來源:Blog.php

示例13: actions

 public function actions()
 {
     return ['toggle' => ['class' => ToggleAction::className(), 'modelClass' => Category::className()]];
 }
開發者ID:ninetor,項目名稱:yii-classifield,代碼行數:4,代碼來源:CategoryController.php


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