Git Product home page Git Product logo

formr's Introduction

##Formr ###What is Formr? Formr is a form generator designed to be used in conjusction with the Kohana ORM module. Formr generates a full create or edit form for any given ORM Model passed to it and allows developers to customize the output to suites their needs. ###How do I use it? Simply call the Formr::create() or Formr::edit() methods and output the response, passing any valid ORM Model and some options if you like:

Formr::create($model[,$options])->render();

To render an edit form:

Formr::edit($model, $id[, $options])->render();

Formr::edit requires an additonal id parameter to render the objects properties. ###Options

Key Type Default Example
actions mixed false array('submit','reset')
enctype string 'application/x-www-form-urlencoded' 'multipart/form-data'
exclude array array() array('id','created')
classes array array() array('name' => 'name-class')
labels array array() array('name' => 'Full Name', 'address' => 'Full Address')
placeholders array array() array('name' => 'Enter your name here')
types array array() array('email' => 'email')
errors array array() array('name' => 'name must be entered') //standard ORM validation error array
help array array() array('name' => 'Enter your name here')
disabled array array() array('email','phone')
group_by array array() array('name' => 'Enter your name here')
fieldsets boolean false 'name' => 'organisation'
additional array array() 'password_confirm'
legend string '' 'Form'
sources array array() array('title' => array('mr' => 'Mr', 'mrs' => 'Mrs', 'miss' => 'Miss', 'dr' => 'Dr')
order mixed false array('name','email','address')
values array array() array('date' => time())
filters array array() 'filters' => array('organization' => array('order_by' => array(array('name','ASC'))),),
display array array() array('name' => 'fullname')
attributes array array() array('name' => array('required' => true))
tabs false false true
html array array() array('name' => View::factory('name/input')->render())
###Basic Example
Formr::create('person')->render();
###ComplexExample
Coming Soon

formr's People

Contributors

emptyhammond avatar lukenofurther avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.