本文整理汇总了PHP中js::ajaxFile方法的典型用法代码示例。如果您正苦于以下问题:PHP js::ajaxFile方法的具体用法?PHP js::ajaxFile怎么用?PHP js::ajaxFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类js
的用法示例。
在下文中一共展示了js::ajaxFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMyProfile
private function getMyProfile()
{
$pre = "<p>Your profile is used to determine how you get updates to your tickets, billing notifications as well as your picture that is shown for your ticket updates.</p>";
$span = [];
$fields = [];
$fields[] = ['type' => 'ajax', 'id' => 'profilePicture', 'text' => 'Profile Picture:'];
$fields[] = ['type' => 'password', 'var' => 'user_password', 'text' => 'Change Password:'];
$fields[] = ['type' => 'input', 'text' => 'Cell Phone Number:', 'var' => 'user_sms', 'val' => $this->user->user_sms, 'class' => 'sms'];
$opts = [];
$opts[] = ['val' => $this->user->user_cansms, 'text' => $this->user->user_cansms ? "Yes" : 'No'];
$opts[] = ['val' => $this->user->user_cansms, 'text' => '--------------'];
$opts[] = ['val' => 'Y', 'text' => 'Yes'];
$opts[] = ['val' => 'N', 'text' => 'No'];
$fields[] = ['type' => 'select', 'var' => 'user_cansms', 'opts' => $opts, 'text' => 'Send Text Messages?', 'comment' => 'If set to Yes, you will be sent a text when tickets are updated or you are billed.'];
$span[] = ['span' => 6, 'elements' => $fields];
$fields = [];
$fields[] = ['type' => 'input', 'text' => 'Other E-mail Addresses:', 'var' => 'user_altemails', 'val' => $this->user->user_altemails, 'comment' => "Enter any secondary email addresses separated by commas"];
$span[] = ['span' => 6, 'elements' => $fields];
$this->exportJS(js::maskInput('sms', '1-999-999-9999'));
$this->exportJS(js::ajaxFile('profilePicture', "profilePic"));
return $pre . form::init()->id('myProfileForm')->post('/')->spanelements($span)->render();
}
示例2: createUploadForm
private function createUploadForm(&$ticket)
{
$pre = "<p>You can upload any type of file into the ticket. The file must not exceed 20MB in size. If you wish to upload a file larger than 20MB, please make prior arrangements to send to another e-mail address.</p>";
$fields = [];
$fields[] = ['type' => 'input', 'text' => 'Description:', 'var' => 'file_title'];
$fields[] = ['type' => 'ajax', 'text' => 'Upload:', 'id' => 'uploadBlock'];
$this->exportJS(js::ajaxFile('uploadBlock', "t_{$ticket['id']}"));
return $pre . form::init()->post('/ticket/')->elements($fields)->id('newUploadForm')->render();
}