Last active
October 7, 2015 15:47
-
-
Save tristanbes/3188331 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AwesomeNamespace\AwesomeBundle\Admin; | |
use Sonata\AdminBundle\Admin\Admin; | |
use Sonata\AdminBundle\Form\FormMapper; | |
use Sonata\AdminBundle\Datagrid\ListMapper; | |
/** | |
* Profile Admin | |
*/ | |
class ProfileAdmin extends Admin | |
{ | |
/** | |
* Configure the list | |
* | |
* @param \Sonata\AdminBundle\Datagrid\ListMapper $list list | |
*/ | |
protected function configureListFields(ListMapper $list) | |
{ | |
$list | |
->addIdentifier('name', null, array('label' => 'Name')) | |
->add('description', null, array('label' => 'Description')); | |
} | |
/** | |
* Configure the form | |
* | |
* @param FormMapper $formMapper formMapper | |
*/ | |
public function configureFormFields(FormMapper $formMapper) | |
{ | |
$formMapper | |
->add('translations', 'a2lix_translations', array( | |
'by_reference' => false, | |
'locales' => array('fr', 'en')) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mrcmorales Sorry it seems that github didn't send me notif so i didn't see your comments.
For the __toString, don't worry about it, just put :