本文整理汇总了PHP中JFormFieldText::getLayoutData方法的典型用法代码示例。如果您正苦于以下问题:PHP JFormFieldText::getLayoutData方法的具体用法?PHP JFormFieldText::getLayoutData怎么用?PHP JFormFieldText::getLayoutData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JFormFieldText
的用法示例。
在下文中一共展示了JFormFieldText::getLayoutData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLayoutData
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.7
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
// Initialize some field attributes.
$maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : '';
// Note that the input type "url" is suitable only for external URLs, so if internal URLs are allowed
// we have to use the input type "text" instead.
$inputType = $this->element['relative'] ? 'type="text"' : 'type="url"';
$extraData = array('maxLength' => $maxLength, 'inputType' => $inputType);
return array_merge($data, $extraData);
}
示例2: getLayoutData
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.5
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
$extraData = array('maxLength' => $this->maxLength, 'multiple' => $this->multiple);
return array_merge($data, $extraData);
}