Skip to content

Instantly share code, notes, and snippets.

@bourg-ismael
Created March 3, 2015 10:02
Show Gist options
  • Save bourg-ismael/990b638f23875117af86 to your computer and use it in GitHub Desktop.
Save bourg-ismael/990b638f23875117af86 to your computer and use it in GitHub Desktop.
$locale = new \Application\Common\Persistance\Form\Element\ObjectSelect();
$locale
->setName('locale')
->setOptions([
'object_manager' => $this->getObjectManager(),
'property' => 'isoCode',
'target_class' => 'Application\Common\Entity\Locale',
'is_method' => true,
'attributes' => ['data-flag' => ''],
'find_method' => [
'name' => 'findByIsActive',
'params' => [
'isActive' => true
],
]
])
->setAttributes([
'value' => $identity->getLocale(),
'columnClass' => 'col-md-1 locale-column',
'class' => 'select2-locale'
])
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment