Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/proloser/cakephp-splitform-helper
Splits grouped form inputs into separate groups or individual inputs
https://github.com/proloser/cakephp-splitform-helper
Last synced: 9 days ago
JSON representation
Splits grouped form inputs into separate groups or individual inputs
- Host: GitHub
- URL: https://github.com/proloser/cakephp-splitform-helper
- Owner: ProLoser
- Created: 2010-11-08T01:18:20.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2010-11-10T03:01:31.000Z (about 14 years ago)
- Last Synced: 2023-04-19T21:16:53.927Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 93.8 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CakePHP Split Form Helper
This helper allows you to break apart multi-selects, checkbox groups, and radio groups into multiple places on the page.If you've ever wanted something like:
> __[ ] Choice A__
> This choice would give you lots of options such as:
> - Long hair
> - Youthful vigor
> - STDs
>
> __[ ] Choice B__> This is the wrong choice. People who select it are:
> - Morons
> - Short
> - Have EDThis allows you to add content in between the form inputs. You can also separate inputs into small groups.
> __Fruits:__
> - ( ) Apple
> - ( ) Orange
> - ( ) Pair> __Vegatables:__
> - ( ) Cabbage
> - ( ) Carrots
> - ( ) Potatoes## How to use
1. Clone/Download toplugins/split_form
2. Add the helper to your controllervar $helpers = array('SplitForm.SplitForm');
3. Set the view variable in the controller$this->set('categories', $this->Post->Category->find('list'));
4. Call the method:#### For one specific value
echo $this->SplitForm->input('Category', 7);#### For multiple inputs
echo $this->SplitForm->input('Category', array(3, 2, 6, 7));#### Advanced options
echo $this->SplitForm->input('Category', array(
3 => 'Category 3',
2 => array('label' => 'Category 2', 'class' => 'special')
), array('legend' => 'Category group 1'));