本文整理汇总了PHP中Psc\Code\Code::camelCaseToDash方法的典型用法代码示例。如果您正苦于以下问题:PHP Code::camelCaseToDash方法的具体用法?PHP Code::camelCaseToDash怎么用?PHP Code::camelCaseToDash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Psc\Code\Code
的用法示例。
在下文中一共展示了Code::camelCaseToDash方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->execInput = $input;
$this->execOutput = $output;
$this->initDoctrine($input, $output);
$project = $this->getProject();
$package = $this->getPackage();
$name = $input->getArgument('name');
$contexts = (array) $input->getArgument('contexts');
if (empty($contexts)) {
$contexts = array('page-content');
}
$section = $this->validateOptionalString($input->getOption('section'));
$label = $this->validateOptionalString($input->getOption('label'));
$this->widgetsDir = $project->dir('resources')->sub('widgets/');
$this->info('Creating Widget ' . $name . ' in ' . $this->widgetsDir);
$this->jsonc = new JSONConverter();
$specification = $this->getSpecification($name, $contexts, $section, $label);
$template = $this->getTemplate($specification);
$dashName = Code::camelCaseToDash($name);
$tableName = 'cs_' . str_replace('-', '_', $dashName) . 's';
$tableName = $this->askDefault('TableName for Entity', $tableName);
$entityExists = FALSE;
try {
$this->callCommand('cms:create-entity', array('name' => 'ContentStream\\' . $name, 'tableName' => $tableName), $output);
} catch (\Psc\Code\Generate\ClassWritingException $e) {
$entityExists = TRUE;
$this->warn('Your entity was already created before. I will not recreate it.');
}
$this->comment('put this to the discrimination map from ContentStream\\Entry' . ($entityExists ? ' (if not already)' : '') . ': ');
$this->comment(' "' . $dashName . '" = "' . $name . '",');
$this->br();
if ($this->confirm('Should I compile the entities, now?')) {
$this->callCommand('project:compile', array('--con' => 'tests'), $output);
$this->br();
}
if ($this->confirm('Should I compile js templates, now?')) {
system('grunt hogan');
$this->br();
}
$this->info('finished.');
return 0;
}
示例2: getEntityName
/**
* Der EntityName ist eine KurzForm der Klasse
*
* Dies ist für \tiptoi\Entities\Sound z. b. "sound"
*/
public function getEntityName()
{
return Code::camelCaseToDash($this->getGClass()->getClassName());
}