-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update choice.rst #9071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update choice.rst #9071
Conversation
FIX parametro atributo para añadir clase css
reference/forms/types/choice.rst
Outdated
//Version 3.3 no funciona choice_attr. | ||
//Lo correcto es | ||
//'attr' => array('class' => 'form-control') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hola @jmangarret!
Hay dos opciones distintas: attr
y choice_attr
. La diferencia es que attr
affecta el form control principal (e.g. el elemento select
) mientras choice_attr
se aplica a los elementos option
. Pero, es cierto que no tenemos un ejemplo en esta página de attr
. Por eso, yo he cambiado este PR para arreglar el problema.
I've updated the PR - we had no mention of the |
Perfecto! Entendido...
El 18/01/2018 16:29, "Ryan Weaver" <notifications@github.com> escribió:
*@weaverryan* commented on this pull request.
------------------------------
In reference/forms/types/choice.rst
<#9071 (comment)>:
@@ -99,6 +99,10 @@ method::
'choice_attr' => function($category, $key, $index) {
return ['class' => 'category_'.strtolower($category->getName())];
},
+ //Version 3.3 no funciona choice_attr.
+ //Lo correcto es
+ //'attr' => array('class' => 'form-control')
+
Hola @jmangarret <https://github.com/jmangarret>!
Hay dos opciones distintas: attr y choice_attr. La diferencia es que attr
affecta el form control principal (e.g. el elemento select) mientras
choice_attr se aplica a los elementos option. Pero, es cierto que no
tenemos un ejemplo en esta página de attr. Por eso, yo he cambiado este PR
para arreglar el problema.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9071 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHBXaVP4j2XKuBzXKlTIMGQD63ckfIoHks5tL7CTgaJpZM4RhlGT>
.
|
Tengo un problema. Podrán ayudarme? Cuando hago submit (newAction) de un
EntityType no recibo el id sino un objeto. Como puedo obtener el id del
EntityType para poder guardar los datos?
El error generado es:
An exception occurred while executing 'INSERT INTO promocion (id_producto,
fecha_creacion, hora_desde, hora_hasta, valor_venta, status) VALUES (?, ?,
?, ?, ?, ?)' with params [{}, "2018-01-18", "10:00:00", "12:00:00", 2000,
1]:
Notice: Object of class BillarBundle\Entity\Producto could not be converted
to int
Y el codigo del control del formulario es el siguiente:
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('idProducto',
EntityType::class,
array(
'class' => 'BillarBundle:Producto',
'choice_label' => 'nombre',
'placeholder' => 'Seleccione una opción',
'attr' => array('class' => 'form-control'),
)
)
El 18/01/2018 16:29, "Ryan Weaver" <notifications@github.com> escribió:
*@weaverryan* commented on this pull request.
------------------------------
In reference/forms/types/choice.rst
<#9071 (comment)>:
@@ -99,6 +99,10 @@ method::
'choice_attr' => function($category, $key, $index) {
return ['class' => 'category_'.strtolower($category->getName())];
},
+ //Version 3.3 no funciona choice_attr.
+ //Lo correcto es
+ //'attr' => array('class' => 'form-control')
+
Hola @jmangarret <https://github.com/jmangarret>!
Hay dos opciones distintas: attr y choice_attr. La diferencia es que attr
affecta el form control principal (e.g. el elemento select) mientras
choice_attr se aplica a los elementos option. Pero, es cierto que no
tenemos un ejemplo en esta página de attr. Por eso, yo he cambiado este PR
para arreglar el problema.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9071 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHBXaVP4j2XKuBzXKlTIMGQD63ckfIoHks5tL7CTgaJpZM4RhlGT>
.
|
@jmangarret we're sorry but on this repository we don't provide Symfony support. You can use any of the channels listed here: https://symfony.com/support For example, in the Symfony Slack there's a #support channel for questions in English and a #symfony-es channel for questions in Spanish. |
All right! Thank you
El 19/01/2018 03:37, "Javier Eguiluz" <notifications@github.com> escribió:
… @jmangarret <https://github.com/jmangarret> we're sorry but on this
repository we don't provide Symfony support. You can use any of the
channels listed here: https://symfony.com/support For example, in the
Symfony Slack there's a #support channel for questions in English and a
#symfony-es channel for questions in Spanish.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9071 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHBXaboz48Cy2ZvwsBTI_fz2UNnU5_6Iks5tME1NgaJpZM4RhlGT>
.
|
FIX parametro atributo para añadir clase css