定制 alengo/alengo-form-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alengo/alengo-form-bundle

最新稳定版本:3.0.2

Composer 安装命令:

composer require alengo/alengo-form-bundle

包简介

Form Bundle

README 文档

README

GitHub license GitHub tag (latest SemVer) Sulu compatibility

Requirements

  • Sulu 3.x
  • PHP 8.2
  • Symfony >=7.2
  • Symfonymailer >=7.2

Install the bundle

Execute the following composer command

composer require alengo/alengo-form-bundle

Enable the bundle

Enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

return [
    /* ... */
    Alengo\Bundle\AlengoFormBundle\AlengoFormBundle::class => ['all' => true],
];
bin/console do:sch:up --force

Configure the Bundle

Set the following config in your routes_admin.yaml

AlengoFormBundle:
   resource: "@AlengoFormBundle/config/routing_admin.yaml"
   prefix: /admin/api

Define you default Sender Email in ENV Config.

   DEFAULT_SENDER_MAIL=test@test.de
   DEFAULT_SENDER_NAME=Mustermann

Use the Bundle

You can use and include the following two interfaces to save the forms and send an email with them

Alengo\Bundle\AlengoFormBundle\Service\SaveFormInterface

  public function saveFormDataFromRequest(array $data, string $webspace, string $location, string $category, string $receiverMail = NULL, bool $copy = false): FormData;

Alengo\Bundle\AlengoFormBundle\Service\SendFormInterface

   public function sendFormDataAsMail(FormData $formData, string $template, string $title, string $receiverMail,string $senderMail,$xmlTemplate = false);

Example

Simple example which sends a copy to the person who filled in the form and his deposited mail

$formData = $this->saveForm->saveFormDataFromRequest($request->request->all(),$request->get('_sulu')->getAttribute('webspace')->getKey(),$request->getLocale(),'contact',NULL,true);
$this->sendForm->sendFormDataAsMail($formData,'hello/email.txt.twig','Welcome Mail','receiver@mail.de');

统计信息

  • 总下载量: 1.88k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固