本文整理汇总了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));
}
示例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()}");
}
}
示例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();
}