Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] jak dołączyć formularz na stronę ?
nieraczek
post
Post #1





Grupa: Zarejestrowani
Postów: 405
Pomógł: 6
Dołączył: 12.01.2007

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


Jak wyświetlić na stronie formularz, bo pojawia mi się błąd ?

W actions.class.php mam:
  1. <?php
  2. public function executeStronka(sfWebRequest $request)
  3.  {
  4.    $this->form = new FormularzJedenForm();
  5.  }
  6. ?>


W stronkaSuccess.php mam:
  1. <div id="job">
  2.  
  3. Formularz:
  4. <?php
  5. include_partial('lib/form/FormularzJeden')
  6. ?>
  7.  
  8. </div>


Nie bardzo rozumiem funkcji include_partial(), co mam w nią wpisać ? Dołącza ona zawartość pliku, ale jakoś nie do końca rozumiem, bo często ma jeszcze tablice array().


Poza tym mam jeszcze plik FormularzJedenForm.class.php - umieściłem go w katalogu sf_sandbox\lib\form - jest to chyba właściwe miejsce, bo są tu umieszczone formularze automatycznie wygenerowane przez Symfony.
  1. <?php
  2. class FormularzJedenForm extends sfForm
  3. {
  4.  public function configure()
  5.  {
  6.      $this->setWidgets(array(
  7.      'email'   => new sfWidgetFormInput(),
  8.      'message' => new sfWidgetFormTextarea(),
  9.    ));
  10.  
  11.    $this->setValidators(array(
  12.      'email'   => new sfValidatorEmail(),
  13.      'message' => new sfValidatorString(array('max_length' => 255)),
  14.    ));
  15.  
  16.  }
  17. }
  18. ?>
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 19.08.2025 - 07:49