本文整理汇总了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'));
}
示例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;
}
示例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())) . '}}';
}
示例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;
}
}