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


PHP Code::camelCaseToDash方法代码示例

本文整理汇总了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;
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:43,代码来源:CreateWidgetTemplateCommand.php

示例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());
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:9,代码来源:EntityMeta.php


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