本文整理汇总了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;
}
}
示例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;
}
}
示例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);
}
示例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;
}
示例5: _getMethodName
/**
* @return string
*/
protected function _getMethodName()
{
return CM_Util::uncamelize($this->_method->getName());
}
示例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);
}