Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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")