本文整理汇总了PHP中JString::splitCamelCase方法的典型用法代码示例。如果您正苦于以下问题:PHP JString::splitCamelCase方法的具体用法?PHP JString::splitCamelCase怎么用?PHP JString::splitCamelCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JString
的用法示例。
在下文中一共展示了JString::splitCamelCase方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Method to instantiate the form field object.
*
* @param object $form The form to attach to the form field object.
*
* @since 11.1
*/
public function __construct($form = null)
{
// If there is a form passed into the constructor set the form and form control properties.
if ($form instanceof JForm) {
$this->form = $form;
$this->formControl = $form->getFormControl();
}
// Detect the field type if not set
if (!isset($this->type)) {
$parts = JString::splitCamelCase(get_called_class());
if ($parts[0] == 'J') {
$this->type = JString::ucfirst($parts[count($parts) - 1], '_');
} else {
$this->type = JString::ucfirst($parts[0], '_') . JString::ucfirst($parts[count($parts) - 1], '_');
}
}
}
示例2: __construct
/**
* Method to instantiate the form field object.
*
* @param object $form The form to attach to the form field object.
*
* @since 11.1
*/
public function __construct($form = null)
{
parent::__construct($form);
// Detect the field type if not set
if (!isset($this->type)) {
$parts = JString::splitCamelCase(get_class($this));
if ($parts[0] == 'J') {
$this->type = JString::ucfirst($parts[count($parts) - 1], '_');
} else {
$this->type = JString::ucfirst($parts[0], '_') . JString::ucfirst($parts[count($parts) - 1], '_');
}
}
$this->assets_content = $this->container->getParameter('form.field.assets.context');
}
示例3: __construct
/**
* Method to instantiate the form field object.
*
* @param object $form The form to attach to the form field object.
*
* @since 11.1
*/
public function __construct($form = null)
{
parent::__construct($form);
// Detect the field type if not set
if (!isset($this->type)) {
$parts = JString::splitCamelCase(get_class($this));
if ($parts[0] == 'J') {
$this->type = JString::ucfirst($parts[count($parts) - 1], '_');
} else {
$this->type = JString::ucfirst($parts[0], '_') . JString::ucfirst($parts[count($parts) - 1], '_');
}
}
}
示例4: testSplitCamelCase
/**
* @return void
*
* @dataProvider getSplitCamelCaseData
* @since 11.3
*/
public function testSplitCamelCase($string, $expected)
{
$this->assertThat(JString::splitCamelCase($string), $this->equalTo($expected));
}