websovn / contactform
该包已被放弃且不再维护。未建议替代包。
Webso
v1.0
2022-10-27 04:13 UTC
Requires
- illuminate/collections: ^8.54
- illuminate/config: ^8.55
- illuminate/container: ^8.54
- illuminate/contracts: ^8.54
- illuminate/database: ^8.54
- illuminate/events: ^8.0
- illuminate/filesystem: ^8.55
- illuminate/http: ^8.55
- illuminate/macroable: ^8.54
- illuminate/pagination: ^8.44
- illuminate/support: ^8.0
- illuminate/translation: ^8.55
- illuminate/validation: ^8.58
- smarty/smarty: *
- symfony/console: ^5.3
- symfony/error-handler: *
- symfony/var-dumper: *
README
安装
composer require websovn/contactform
指南 - 有两种主要调用方式
渲染表单
{\Websovn\ContactForm::make()
->action(url(''))
->setNumberShow(1)
->withButton()
->render()}
渲染方法
方法 | 描述 |
---|---|
static function make() |
初始化 |
description(string $description) |
为表单设置描述 |
method(string $method) |
设置表单方法(GET, POST) |
action(string $action) |
设置表单action |
table(string $table) |
设置表名 |
setNumberShow(int $showRepeat) |
设置页面加载后表单显示次数 |
buttonZindex(int $zindex) |
表单调用按钮的zindex值 |
buttonLabel(string $label) |
表单调用按钮的标签 |
buttonIcon(string $icon) |
设置表单调用按钮的图标 |
buttonClassWrap(string $class) |
设置包裹表单调用按钮的div的class |
buttonClass(string $class) |
设置表单调用按钮的class |
function withButton() |
显示表单调用按钮 |
function render() |
将表单渲染到视图 |
处理表单
\Websovn\ContactForm::make()->query(request());
查询方法
命令 | 描述 |
---|---|
static function make() |
初始化 |
isSendMail(bool $isSend = true) |
开启,关闭在成功提交后发送邮件 |
keyReplace(string $keyReplace) |
设置用于替换邮件内容的键 |
subject(string $subject) |
设置邮件主题 |
message(string $message) |
设置邮件内容 |
query(Request $request) |
处理表单 |