tuhin18003/codeigniter-form-builder 问题修复 & 功能扩展

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

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

tuhin18003/codeigniter-form-builder

Composer 安装命令:

composer require tuhin18003/codeigniter-form-builder

包简介

Easily create form in Codeigniter framework.

README 文档

README

This is under heavy construction and in early alpha stages. It is an easy way to create form in Codeigniter developement.

Installation

Bleeding Edge

During your development, you can keep up with the latest changes on the master branch by setting the version requirement for form_builder to dev-master

{
   "require": {
      "tuhin18003/codeigniter-form-builder": "dev-master"
   }
}

Via command line:

composer require tuhin18003/codeigniter-form-builder

How to use:

You can use it very easily on your code and easily create bootstrap from without typing html into view file.

Basic Form Example:

public function index()
{
  $this->load->helper('form');
            
  $form = new \Cs_form\Cs_form();
  $bootstrap = $form->Bootstrap();
            
  $inputs = $bootstrap->generate_basic_form(array(
  	'action' => 'test',
        'attributes' => array( 'class' => 'formclass', 'id' => 'myform' ),
        'fields' => array(
        	array(
                	'type'          => 'text',
                        'label'         => array( 'text' => 'What is your Name', 'id' => 'username', 'attribute' => array( 'class' => '')),
                        'input'          => array(
                            'name'          => 'username',
                            'id'            => 'username',
                            'value'         => 'johndoe',
                            'class'         => 'form-control'
                        )
                    )
                )
            ));
            
   $this->load->view( 'welcome_message', array( 'inputs' => $inputs ) );
}

Inline Form Example:

 $inputs = $bootstrap->generate_inline_form(array(
  	'action' => 'test',
        'attributes' => array( 'id' => 'myform' ),
        'fields' => array(
        	array(
                	'type'          => 'text',
                        'label'         => array( 'text' => 'What is your Name', 'id' => 'username', 'attribute' => array( 'class' => '')),
                        'input'          => array(
                            'name'          => 'username',
                            'id'            => 'username',
                            'value'         => 'johndoe',
                            'class'         => 'form-control'
                        )
                    )
                )
            ));

Horizontal Form Example:

$inputs = $bootstrap->generate_horizontal_form(array(
  	'action' => 'test',
        'attributes' => array( 'id' => 'myform' ),
        'fields' => array(
        	array(
                	'type'          => 'text',
                        'label'         => array( 'text' => 'What is your Name', 'id' => 'username', 'attribute' => array( 'class' => 'col-sm-2 control-label')),
                        'input'          => array(
                            'name'          => 'username',
                            'id'            => 'username',
                            'value'         => 'johndoe',
                            'class'         => 'form-control',
                            'input_wrap_class' => 'col-sm-10'
         )
      )
   )
));
  

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固