当前位置: 首页>>代码示例>>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;未经允许,请勿转载。