定制 encodez/superform 二次开发

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

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

encodez/superform

Composer 安装命令:

composer require encodez/superform

包简介

Advanced form processing for phalcon framework inspired by Laravel and Zend forms

README 文档

README

Simple way to create and validate Phalcon 2 form inpired by the laravel request

Please fork this repository and help improve.

The module is in development stage. This is a quick reference. Still the module and documentation has to be improved. I will be adding more notes as I get time

example:

use Encodez\Superform\Form;
class ClientForm extends Form
{
    public function __construct()
    {
        $this->setMethod(Form::METHOD_POST);
        parent::__construct();
    }

    function getFields()
    {
        return [
            'client_name' => [ 'text', 'Client Name', 'class:form-control'],
            'email' => ['email', 'EMail', 'class:form-control'],
            'building_no' => ['numeric', 'Building No', 'class:form-control'],
            'location_name' => [ 'text', 'Location Name', 'class:form-control location'],
        ];
    }

    function getRules()
    {
        return [
            'client_name' => 'required|length:5,10',
            'building_no' => 'required',
            'email' => 'required|email',
            'location_name' => 'required',
        ];
    }

    /* TODO: Add sanitizers*/
    function getFilters()
    {
        return [
            'client_name' => 'trim'
        ];
    }

    function getCustomMessages()
    {
        return [
            'client_name:required' => 'Client name is required',
            'client_name:length:5,10' => 'Client name must be atleast 5 characters and must not exceed 10',
            'client_name:string' => 'Client name contains invalid characters',
        ];
    }
}

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2015-05-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固