Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [inne][symfony2]Placeholder w add
kosmos
post
Post #1





Grupa: Zarejestrowani
Postów: 367
Pomógł: 17
Dołączył: 4.03.2008

Ostrzeżenie: (0%)
-----


Witam ponownie!

Jak można zastosować parametr placeholder dla formularza w metodzie add?
To oczywiście nie działa (IMG:style_emoticons/default/wink.gif)
  1. $form = $this->createFormBuilder($message)
  2. ->add('name','text',array(
  3. 'label' => 'Imię',
  4. 'placeholder' => 'test'
  5. ))


Ok znalazłem rozwiązanie

  1. $form = $this->createFormBuilder($message)
  2. ->add('surname','text', array(
  3. 'attr' =>
  4. 'placeholder' => 'test')
  5. ))
  6. ->getForm();
Go to the top of the page
+Quote Post
ohm
post
Post #2





Grupa: Zarejestrowani
Postów: 623
Pomógł: 144
Dołączył: 22.12.2010

Ostrzeżenie: (0%)
-----


Chyba tak:
  1. ->add(..., array('attr' => array('placeholder' => 'blabla'));
Go to the top of the page
+Quote Post
kosmos
post
Post #3





Grupa: Zarejestrowani
Postów: 367
Pomógł: 17
Dołączył: 4.03.2008

Ostrzeżenie: (0%)
-----


aj tylko teraz wyświetla mi sie to tak

(IMG:http://naforum.zapodaj.net/thumbs/8bbc6a514790.png)

a nie chce mieć tego surname

update:
dzięki ohm

i tym razem też udało mi się znaleźć rozwiązanie (IMG:style_emoticons/default/smile.gif)

  1. ->add('surname','text', array(
  2. 'label' => false,
  3. 'attr' =>
  4. 'placeholder' => 'test')
  5. ))


(IMG:style_emoticons/default/specool.gif)

Ten post edytował kosmos 28.03.2015, 13:29:36
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 26.09.2025 - 13:32