定制 plum/form 二次开发

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

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

plum/form

Composer 安装命令:

composer require plum/form

包简介

:description

README 文档

README

Latest Version on Packagist Total Downloads Build Status StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

  1. Via Composer
$ composer require plum/form
  1. mở file layout thêm stack vào cuối trang để tự động đẩy code validate js vào
    @stack('scripts')

Tham khảo: https://laravel.com/docs/5.8/blade#stacks

  1. cài đặt validateJS

https://github.com/proengsoft/laravel-jsvalidation/wiki/Laravel-5.6-installation

Usage

in blade template

{!! Pform::open(['url' => route('bt.store'), 'id' => 'form-demo'], \App\Http\Requests\DemoRequest::class) !!}
    {!! Pform::text('name', __('Your name')) !!}
    {!! Pform::email('email', __('Your email')) !!}
    {!! Pform::tel('phone_number', __('Your phone')) !!}
    {!! Pform::url('url', __('Your Site')) !!}
    {!! Pform::number('point', __('Point')) !!}
    {!! Pform::textarea('description', __('Description')) !!}
    {!! Pform::submit(__('Submit')) !!}
{!! Pform::close() !!}

Output:

Output

Other demo

<div class="box box-success">
    <div class="box-header with-border">
        <h3 class="box-title">
            @if(Route::currentRouteName() == 'backend.admin.create')
                {{__('Create new admin')}}
            @else
                {{__('Edit admin')}}
            @endif
        </h3>
    </div>

    @if(Route::currentRouteName() == 'backend.admin.create')
        {!! Pform::open(['url' => route('backend.admin.store'), 'method' => 'POST'], \Modules\Backend\Http\Requests\AdminRequest::class) !!}
    @else
        {!! Pform::model($data, ['url' => route('backend.admin.update', ['id' => $data['id']]), 'method' => 'PUT'], \Modules\Backend\Http\Requests\AdminRequest::class) !!}
    @endif
        <div class="box-body">
            {!! Pform::text('name', __('Name')) !!}
            {!! Pform::email('email', __('Email')) !!}
            {!! Pform::password('password', __('Password')) !!}
            {!! Pform::password('password_confirmation', __('Reenter Password')) !!}
        </div>
        <div class="box-footer">
            {!! Pform::submit(__('Submit'), ['class' => 'btn btn-success']) !!}
        </div>
    {!! Pform::close() !!}
</div>

Publish Configuration

php artisan vendor:publish --provider "Plum\Form\FormServiceProvider"

Form option

Option Type Default Description
id string random duy nhất trên trang HTML, cho phần validate form với javascript, nếu không muốn validate bằng js có thể đưa id này vào cấu hình skip_validate_js trong file cấu hình pform.php
view string form_group tên view sẽ dùng để render lên các phần tử, view này sẽ nằm trong namespace plum
hide_mandatory boolean false true sẽ không hiển thị dấu * đỏ bên cạnh label

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email anhmantk@gmail.com instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固