定制 mouf/mvc.bce 二次开发

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

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

mouf/mvc.bce

最新稳定版本:v4.1.5

Composer 安装命令:

composer require mouf/mvc.bce

包简介

BCE is made to make your live easy. It will help you in building forms very quickly, handles form rendering, both client and server-side validation, and persistance.

README 文档

README

BCE is a form builder for the Mouf framework. Its main goal is making your life easier. It will handle the main aspects of an HTML form:

  • Build the form
  • Perform client and server side validation
  • Persist data into the database

When to use BCE ?

BCE should be used in order to create forms that reflect your business objects, ie BCE is very powerfull for generating the forms for your CRUDs.

Design choices

BCE has been design in order to be quick and easy to use, and also easely customaizable :

  • an advanced form configuration interface that will automatically suggest form fields, and their attributes. In a few words, creating a basic form (including validation and persistance) may take you less than 5 minute!
  • Because specific needs will always come up, you may code your custom field and use it in your form quite simply.

Most simple implemetation

Once you have configured your form, you have about 3 lines to code.

Controller

/**
 * Edit a user
 * @URL user/edit
 * @param int $id : the id of the user to edit (null for adding a new user)
 */
public function addUser($id = null) {
    $this->userFormInstance->load($id);//load the user into the form
    ...
}

/**
 * Save a user
 * @URL user/save
 */
public function saveUser() {
    $this->userFormInstance->save();//save the user
    ...
}

View (display the form)

$this->userFormInstance->toHtml();

Result

Renderer edit form

Ready to dive in? Let's get started!

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 7
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-11-28