Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Formatting choice list options in entity form type
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Pau Peris  
View profile  
 More options Jul 2 2012, 8:01 am
From: Pau Peris <sibok1...@gmail.com>
Date: Mon, 2 Jul 2012 14:01:52 +0200
Local: Mon, Jul 2 2012 8:01 am
Subject: Formatting choice list options in entity form type

Hi,

i'm using Entity form type, choice based, in order to provide a choice list
inside a Sonata Admin form. What i would like is to use a child property to
display the collection of elements inside the choice list.

Does any one knows how to provide the label to be shown inside the chocie
list or how to give format to the choice list array?

    $formMapper->add( 'frArea', 'entity', array(
        'class'             => 'myVendor\myBundleBundle\View\FrArea',
                    //When using a child property here, choice list
gets corrupted/bad formatted
        'property'          => 'idArea',
        'em'                => 'formacions',
        'query_builder'     =>  function( EntityRepository $er )
                                {
                                    return $er->createQueryBuilder( 'qb' )
                                              ->add( 'select', 'a' )
                                              ->add( 'from',
'myVendor\myBundleBundle\View\FrArea a' );
                                              //->leftJoin('a.idiomes', 'ai');
                                },
        'required'          => false,
        'label'             => ucfirst( $this->trans( 'my_label',
array(), $this->translationDomain, $this->langCode ) )

) );


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »