當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。