本文整理匯總了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);
}