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


PHP CM_Util::camelize方法代码示例

本文整理汇总了PHP中CM_Util::camelize方法的典型用法代码示例。如果您正苦于以下问题:PHP CM_Util::camelize方法的具体用法?PHP CM_Util::camelize怎么用?PHP CM_Util::camelize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CM_Util的用法示例。


在下文中一共展示了CM_Util::camelize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getClassnameByPath

 /**
  * @param CM_Frontend_Render $render
  * @param string             $path
  * @throws CM_Exception_Invalid
  * @return string
  */
 public static final function getClassnameByPath(CM_Frontend_Render $render, $path)
 {
     $path = (string) $path;
     $pathTokens = explode('/', $path);
     array_shift($pathTokens);
     // Rewrites code-of-honor to CodeOfHonor
     foreach ($pathTokens as &$pathToken) {
         $pathToken = CM_Util::camelize($pathToken);
     }
     return $render->getClassnameByPartialClassname('Page_' . implode('_', $pathTokens));
 }
开发者ID:cargomedia,项目名称:cm,代码行数:17,代码来源:Abstract.php

示例2: bootstrapProject

 /**
  * @param string|null $projectName
  * @param string|null $domain
  * @param string|null $moduleName
  * @throws CM_Cli_Exception_Internal
  */
 public function bootstrapProject($projectName = null, $domain = null, $moduleName = null)
 {
     $generatorApp = new CM_Tools_Generator_Application($this->_getAppInstallation(), $this->_getStreamOutput());
     $projectName = $this->_read('Please provide project name (vendor/project):', $projectName, null, function ($value) use($generatorApp) {
         if (!$generatorApp->isValidProjectName($value)) {
             throw new CM_InputStream_InvalidValueException('Project name needs to be in `vendor/project` format');
         }
     });
     list($vendorName, $appName) = explode('/', $projectName);
     $defaultDomain = $appName . '.dev';
     $hint = "Please provide local domain [{$defaultDomain}]:";
     $domain = $this->_read($hint, $domain, $defaultDomain, function ($value) use($generatorApp) {
         if (!$generatorApp->isValidDomain($value)) {
             throw new CM_InputStream_InvalidValueException('Invalid domain name');
         }
     });
     $defaultModuleName = CM_Util::camelize($appName);
     $moduleName = $this->_read("Please provide module name [{$defaultModuleName}]:", $moduleName, $defaultModuleName, function ($value) {
         if (!$this->_isValidModuleName($value)) {
             throw new CM_InputStream_InvalidValueException('Invalid name');
         }
     });
     $siteName = $appName;
     $siteClassName = $moduleName . '_Site_' . CM_Util::camelize($siteName);
     try {
         $generatorApp->configureDevEnvironment($appName, $domain);
         $generatorApp->setProjectName($projectName);
         $this->createModule($moduleName);
         $this->createSite($siteClassName, $siteName, $domain);
     } catch (CM_Exception_Invalid $e) {
         throw new CM_Cli_Exception_Internal("Bootstrap failed! {$e->getMessage()}");
     }
 }
开发者ID:aladin1394,项目名称:CM,代码行数:39,代码来源:Cli.php

示例3: _notify

 protected function _notify()
 {
     $arguments = func_get_args();
     $methodName = '_notify' . CM_Util::camelize($this->getVerbName());
     if (is_callable([$this, $methodName])) {
         call_user_func_array(array($this, $methodName), $arguments);
     }
     $this->_track();
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:9,代码来源:Abstract.php


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