netcore/module-form 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

netcore/module-form

Composer 安装命令:

composer require netcore/module-form

包简介

README 文档

README

This module was made for easy management of custom forms such as Contact form, Subscribe form etc.

Pre-installation

This package is part of Netcore CMS ecosystem and is only functional in a project that has following packages installed:

  1. https://github.com/netcore/netcore
  2. https://github.com/netcore/module-admin
  3. https://github.com/netcore/module-translate

Installation

  • Require this package using composer
    composer require netcore/module-form
  • Publish assets/configuration/migrations
    php artisan module:publish Form
    php artisan module:publish-config Form
    php artisan module:publish-migration Form
    php artisan migrate

Configuration

  • Configuration file is available at config/netcore/module-form.php

Usage

  • Render form
    app('forms')->replace('[form=(ID/Key)]');
    // or you can use helper method 
    form()->render('ID/Key');
  • Custom template
    If you want to render form with different template,
    you can create new file in /views/templates/forms (path can be changed in configuration),
    for example - contact-us.blade.php, where "contact-us" can be form key or the template name set when creating/editing form
  • Extend form submit functionality
    // For example, if you want to send email to Administrator and/or User, who submitted the "Contact Us" form
    use Modules\Form\Repositories\FormsRepository;
    use Nwidart\Modules\Facades\Module;
    
    $module = Module::find('form');
    if ($module AND $module->enabled()) {
        FormsRepository::addNewEvent('contact-us', function ($data) {
            Mail::to('admin@example.com')->queue(new NotifyAboutContactMessage($data));
        });
    }
    // $data variable is array, which consists of submitted data, for example
    $data = [
        'name'      => 'John',
        'email'     => 'example@example.com',
        'message'   => 'Lorem ipsum.'
    ];

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 6
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-10-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固