0

Im having the following problem. If I try to use this code

$form = $this->createFormBuilder()
 ->add('code', 'integer', array(
 'attr' => array('class' => 'login-input')
 ))
 ->add('einlösen', 'submit', array(
 'attr' => array('class' => 'login-submit')
 ))
 ->getForm();

my browser doesnt show the ö in einlösen. If i remove the class attr it works. I thought this might be a css issue but the problem seems to be with symfony, since there is no matter what class I use the ö always gets mangled.

Another thing I realized is that if I do a cache clear the ö is there but as soon as i press the button once and reload the page its not showing up properly again.

asked Dec 11, 2014 at 10:43
1
  • 1
    Can't you add a label to this field? Does your entity property has also an umlaut? Commented Dec 11, 2014 at 11:00

1 Answer 1

1

Try to use the label option:

$this->createFormBuilder()
 ->add('submit', 'submit', array(
 'label' => 'einlösen',
 'attr' => array('class' => 'login-submit')
 ))

As an alternative you can set/overwrite the label in twig:

{{ form_widget(form.submit, { 'label': 'einlösen' }) }}
answered Dec 11, 2014 at 13:30
Sign up to request clarification or add additional context in comments.

3 Comments

As he said in response to my comment, it's a button, it won't help him.
hmm the submitType has a label though... but well I generally would recommend switching language of the code to english and move definition of (german) labels to the frontend / translation files.
it seems to work this way. Sorry Veve I misunderstood you there.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.