Skip to content

Latest commit

History

136 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

##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

KeyTypeDefaultExample
actionsmixedfalsearray('submit','reset')
enctypestring'application/x-www-form-urlencoded''multipart/form-data'
excludearrayarray()array('id','created')
classesarrayarray()array('name' => 'name-class')
labelsarrayarray()array('name' => 'Full Name', 'address' => 'Full Address')
placeholdersarrayarray()array('name' => 'Enter your name here')
typesarrayarray()array('email' => 'email')
errorsarrayarray()array('name' => 'name must be entered') //standard ORM validation error array
helparrayarray()array('name' => 'Enter your name here')
disabledarrayarray()array('email','phone')
group_byarrayarray()array('name' => 'Enter your name here')
fieldsetsbooleanfalse'name' => 'organisation'
additionalarrayarray()'password_confirm'
legendstring'''Form'
sourcesarrayarray()array('title' => array('mr' => 'Mr', 'mrs' => 'Mrs', 'miss' => 'Miss', 'dr' => 'Dr')
ordermixedfalsearray('name','email','address')
valuesarrayarray()array('date' => time())
filtersarrayarray()'filters' => array('organization' => array('order_by' => array(array('name','ASC'))),),
displayarrayarray()array('name' => 'fullname')
attributesarrayarray()array('name' => array('required' => true))
tabsfalsefalsetrue
htmlarrayarray()array('name' => View::factory('name/input')->render())
###Basic Example
Formr::create('person')->render();
###ComplexExample
Coming Soon

About

ORM form generator

Resources

Stars

3 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages