本文整理汇总了PHP中UploadField::setExtra方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadField::setExtra方法的具体用法?PHP UploadField::setExtra怎么用?PHP UploadField::setExtra使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadField
的用法示例。
在下文中一共展示了UploadField::setExtra方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadField
/**
* FormHandler::uploadField()
*
* Create a uploadField on the form
*
* @param string $title: The title of the field
* @param string $name: The name of the field
* @param array $config: The configuration used for the field
* @param string $validator: The validator which should be used to validate the value of the field
* @param string $extra: CSS, Javascript or other which are inserted into the HTML tag
* @param string $alertOverwrite: Do we have to alert the user when he/she is going to overwrite a file?
* @return void
* @access public
* @author Teye Heimans
*/
function uploadField($title, $name, $config = array(), $validator = null, $extra = null, $alertOverwrite = null)
{
require_once FH_INCLUDE_DIR . 'fields/class.UploadField.php';
// create a new uploadfield
$fld = new UploadField($this, $name, $config);
if (!empty($validator)) {
$fld->setValidator($validator);
}
if (!empty($extra)) {
$fld->setExtra($extra);
}
if (!is_null($alertOverwrite)) {
$fld->setAlertOverwrite($alertOverwrite);
}
// register the field
$this->_registerField($name, $fld, $title);
// set that this form is using uploadfields
$this->_upload[] = $name;
}