Skip to content

Instantly share code, notes, and snippets.

@robwilkerson
Created November 23, 2011 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robwilkerson/1389021 to your computer and use it in GitHub Desktop.
Save robwilkerson/1389021 to your computer and use it in GitHub Desktop.
CakePHP: Populate a dropdown with `optgroup` tags
# Populate the dropdown
$activities = $this->ActivityLog->Activity->find(
'all',
array(
'order' => array( 'Activity.display_order' ),
)
);
$activities = Set::combine( $activities, '{n}.Activity.id', '{n}.Activity.name', '{n}.Activity.type' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment