Search code examples
phpmysqllithium

Lithium select options from mysql data


I have a MySQL table categories with following columns:

  • id
  • name

I retrieved the data using

$categories = Categories::find('all');

Now, I want to create a <select> tag with options whose value is $category->id and title is $category->name using form helper.

How to do that?


Solution

  • try $categories = Categories::find('list');