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


PHP CM_Util::uncamelize方法代码示例

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


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

示例1: __construct

 /**
  * @param string            $verbName
  * @param CM_Model_User|int $actor
  * @param int               $typeEmail
  */
 public function __construct($verbName, $actor, $typeEmail)
 {
     parent::__construct($verbName, $actor);
     $typeEmail = (int) $typeEmail;
     try {
         $className = CM_Mail_Mailable::_getClassName($typeEmail);
         $this->_nameEmail = ucwords(CM_Util::uncamelize(str_replace('_', '', preg_replace('#\\A[^_]++_[^_]++_#', '', $className)), ' '));
     } catch (CM_Class_Exception_TypeNotConfiguredException $exception) {
         CM_Service_Manager::getInstance()->getLogger()->warning('Unrecognized mail type when creating mail action', (new CM_Log_Context())->setException($exception));
         $this->_nameEmail = (string) $typeEmail;
     }
 }
开发者ID:cargomedia,项目名称:cm,代码行数:17,代码来源:Email.php

示例2: __construct

 /**
  * @param string            $verbName
  * @param CM_Model_User|int $actor
  * @param int               $typeEmail
  */
 public function __construct($verbName, $actor, $typeEmail)
 {
     parent::__construct($verbName, $actor);
     $typeEmail = (int) $typeEmail;
     try {
         $className = CM_Mail::_getClassName($typeEmail);
         $this->_nameEmail = ucwords(CM_Util::uncamelize(str_replace('_', '', preg_replace('#\\A[^_]++_[^_]++_#', '', $className)), ' '));
     } catch (CM_Class_Exception_TypeNotConfiguredException $exception) {
         $exception->setSeverity(CM_Exception::WARN);
         CM_Bootloader::getInstance()->getExceptionHandler()->handleException($exception);
         $this->_nameEmail = (string) $typeEmail;
     }
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:18,代码来源:Email.php

示例3: getPath

 /**
  * @param array|null $params
  * @return string
  */
 public static function getPath(array $params = null)
 {
     $pageClassName = get_called_class();
     $list = explode('_', $pageClassName);
     // Remove first parts
     foreach ($list as $index => $entry) {
         unset($list[$index]);
         if ($entry == 'Page') {
             break;
         }
     }
     // Converts upper case letters to dashes: CodeOfHonor => code-of-honor
     foreach ($list as $index => $entry) {
         $list[$index] = CM_Util::uncamelize($entry);
     }
     $path = '/' . implode('/', $list);
     if ($path == '/index') {
         $path = '/';
     }
     return CM_Util::link($path, $params);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:25,代码来源:Abstract.php

示例4: getNamedForMethod

 /**
  * @param ReflectionMethod $method
  * @return string[]
  */
 public static function getNamedForMethod(ReflectionMethod $method)
 {
     $params = array();
     $method->getDocComment();
     foreach ($method->getParameters() as $param) {
         if ($param->isOptional()) {
             $paramName = $param->getName();
             $paramString = '--' . CM_Util::uncamelize($paramName);
             $value = 'value';
             if (preg_match('/\\*\\s+@param\\s+([^\\$]*)\\s*\\$' . preg_quote($paramName) . '\\s*([^@\\*]*)/', $method->getDocComment(), $matches)) {
                 if ($commentValue = trim($matches[2])) {
                     $value = $commentValue;
                 }
                 if (preg_match('/bool(ean)?/', $matches[1])) {
                     $value = false;
                 }
             }
             if ($value !== false) {
                 $paramString .= '=<' . $value . '>';
             }
             $params[] = $paramString;
         }
     }
     return $params;
 }
开发者ID:cargomedia,项目名称:cm,代码行数:29,代码来源:Arguments.php

示例5: _getMethodName

 /**
  * @return string
  */
 protected function _getMethodName()
 {
     return CM_Util::uncamelize($this->_method->getName());
 }
开发者ID:cargomedia,项目名称:cm,代码行数:7,代码来源:Command.php

示例6: getLabel

 /**
  * @return string
  */
 public function getLabel()
 {
     $actionName = CM_Util::uncamelize(str_replace('_', '', preg_replace('#\\A[^_]++_[^_]++_#', '', get_called_class())), ' ');
     $verbName = strtolower(str_replace('_', ' ', $this->getVerbName()));
     return ucwords($actionName . ' ' . $verbName);
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:9,代码来源:Abstract.php


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