当前位置: 首页>>代码示例>>PHP>>正文


PHP Inflector::tableize方法代码示例

本文整理汇总了PHP中yii\helpers\Inflector::tableize方法的典型用法代码示例。如果您正苦于以下问题:PHP Inflector::tableize方法的具体用法?PHP Inflector::tableize怎么用?PHP Inflector::tableize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\helpers\Inflector的用法示例。


在下文中一共展示了Inflector::tableize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testTableize

 public function testTableize()
 {
     $this->assertEquals("customer_tables", Inflector::tableize('customerTable'));
 }
开发者ID:howq,项目名称:yii2,代码行数:4,代码来源:InflectorTest.php

示例2: createSecureItemName

 /**
  * @return string
  */
 public function createSecureItemName()
 {
     if (!($template = $this->secureItemTemplate)) {
         $uniquePart = strtoupper(Inflector::tableize((new \ReflectionClass($this->owner))->getShortName()));
         $template = 'ACCESS_' . $uniquePart;
     }
     $primaryKeys = $this->owner->getPrimaryKey(true);
     foreach ($primaryKeys as $value) {
         $template .= '_' . $value;
     }
     return $template;
 }
开发者ID:yii2-tools,项目名称:yii2-secure-ar,代码行数:15,代码来源:SecureBehavior.php

示例3: tableName

 /**
  * Declares the name of the database table associated with this AR class.
  * By default this method returns the class name as the table name that is equal to plurlized form
  * of class name with camel case converted to lower case with words concatenated with underscopes.
  * For example, 'Customer' becomes '{{%customers}}', and 'OrderItem' becomes
  * '{{%order_items}}'. You may override this method if the table is not named after this convention.
  * @return string the table name
  */
 public static function tableName()
 {
     return '{{%' . Inflector::tableize(StringHelper::basename(get_called_class())) . '}}';
 }
开发者ID:omnilight,项目名称:yz2,代码行数:12,代码来源:ActiveRecord.php

示例4: attach

 public function attach($owner)
 {
     parent::attach($owner);
     $folder = Inflector::tableize(StringHelper::basename($this->owner->className()));
     if (!$this->basePath) {
         $this->basePath = '@static/' . $folder;
     }
     if (!$this->baseUrl) {
         $this->baseUrl = '@staticUrl/' . $folder;
     }
 }
开发者ID:maddoger,项目名称:yii2-filebehavior,代码行数:11,代码来源:FileBehavior.php


注:本文中的yii\helpers\Inflector::tableize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。