本文整理汇总了PHP中PKPString::ucfirst方法的典型用法代码示例。如果您正苦于以下问题:PHP PKPString::ucfirst方法的具体用法?PHP PKPString::ucfirst怎么用?PHP PKPString::ucfirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PKPString
的用法示例。
在下文中一共展示了PKPString::ucfirst方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseTypeName
/**
* @see TypeDescription::parseTypeName()
*/
function parseTypeName($typeName)
{
// Standard validators are based on string input.
parent::parseTypeName('string');
// Split the type name into validator name and arguments.
$typeNameParts = explode('(', $typeName, 2);
switch (count($typeNameParts)) {
case 1:
// no argument
$this->_validatorArgs = '';
break;
case 2:
// parse arguments (no UTF8-treatment necessary)
if (substr($typeNameParts[1], -1) != ')') {
return false;
}
// FIXME: Escape for PHP code inclusion?
$this->_validatorArgs = substr($typeNameParts[1], 0, -1);
break;
}
// Validator name must start with a lower case letter
// and may contain only alphanumeric letters.
if (!PKPString::regexp_match('/^[a-z][a-zA-Z0-9]+$/', $typeNameParts[0])) {
return false;
}
// Translate the validator name into a validator class name.
$this->_validatorClassName = 'Validator' . PKPString::ucfirst($typeNameParts[0]);
return true;
}
示例2: setRuntimeEnvironment
/**
* Set the required runtime environment
* @param $runtimeEnvironment RuntimeEnvironment
*/
function setRuntimeEnvironment(&$runtimeEnvironment)
{
assert(is_a($runtimeEnvironment, 'RuntimeEnvironment'));
$this->_runtimeEnvironment =& $runtimeEnvironment;
// Inject the runtime settings into the data object
// for persistence.
$runtimeSettings = $this->supportedRuntimeEnvironmentSettings();
foreach ($runtimeSettings as $runtimeSetting => $defaultValue) {
$methodName = 'get' . PKPString::ucfirst($runtimeSetting);
$this->setData($runtimeSetting, $runtimeEnvironment->{$methodName}());
}
}