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