Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leocaseiro/enumtoselectcakephp
Form Helper: Enum Fields to Select Boxes
https://github.com/leocaseiro/enumtoselectcakephp
Last synced: 4 days ago
JSON representation
Form Helper: Enum Fields to Select Boxes
- Host: GitHub
- URL: https://github.com/leocaseiro/enumtoselectcakephp
- Owner: leocaseiro
- License: mit
- Created: 2014-04-08T16:51:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-30T07:25:45.000Z (about 9 years ago)
- Last Synced: 2024-11-10T13:47:57.206Z (2 months ago)
- Language: PHP
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ENumToSelectCakePHP
===================Form Helper: Enum Fields to Select Boxes
Based on http://bakery.cakephp.org/articles/christian.kilb/2010/09/09/form-helper-enum-fields-to-select-boxes, re-builded following the theotherdy's instructions.
## Installation
### #1 Add the attribute $helpers in your Controller:
public $helpers = array('Form2');
### #2 Usage on View:Form->create('YourModel');
echo $this->Form2->input('YourModel.your_field', array('type' => 'select')); //For select field (Default)
echo $this->Form2->input('YourModel.your_field', array('type' => 'radio')); //For radio field
echo $this->Form->end('Submit');
?>[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/leocaseiro/enumtoselectcakephp/trend.png)](https://bitdeli.com/free "Bitdeli Badge")