本文整理汇总了PHP中Strings::camel方法的典型用法代码示例。如果您正苦于以下问题:PHP Strings::camel方法的具体用法?PHP Strings::camel怎么用?PHP Strings::camel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Strings
的用法示例。
在下文中一共展示了Strings::camel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCamel
public function testCamel()
{
$this->assertEquals('hereIAm', Strings::camel('Here I am'));
$this->assertEquals('hereIAm', Strings::camel('Here-I am'));
$this->assertEquals('hereIAm', Strings::camel('Here I am!'));
$this->assertEquals('hereIAm', Strings::camel(',Here I am'));
$this->assertEquals('meVoila', Strings::camel('Me voilà'));
}
示例2: generate_migration
public function generate_migration($name, $format = 'php', $pluginName = '')
{
if (!empty($pluginName)) {
$basepath = PluginRegistry::initPlugin($pluginName);
} else {
$basepath = APP_ROOT;
}
$file = $basepath . 'db/migrations/' . date('YmdHi') . '_' . Strings::snake($name) . '.' . $format;
$classname = Strings::camel($name);
$source = file_get_contents(dirname(__FILE__) . '/generate/migration/' . $format . '.tpl');
$source = str_replace('[MIGRATION_NAME]', $classname, $source);
file_put_contents($file, $source);
$this->line($file . ' created');
}
示例3: _migrations_in_folder
protected static function _migrations_in_folder($folder, &$out)
{
foreach (FileUtils::getFiles($folder) as $file) {
if (preg_match('`^(\\d+)_(.+)\\.(php|sql)$`', basename($file), $matches)) {
$out[$matches[1]] = array('file' => $folder . $file, 'class' => 'Migration_' . Strings::camel($matches[2]), 'description' => str_replace('_', ' ', $matches[2]), 'type' => $matches[3]);
}
}
}