Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] Problem z form
dzesi
post
Post #1





Grupa: Zarejestrowani
Postów: 235
Pomógł: 0
Dołączył: 3.05.2006

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


Witam od niedawna poznaje mvc i poznaje zend framework od wczoraj (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) i mam problem z zend_form

Mam problem z stworzeniem formularza w zend czytam dokumentacje ale nie wszystko rozumie (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

kontroler

  1. <?php
  2.  
  3. class RejController extends Zend_Controller_Action
  4. {
  5.  
  6. public function getForm()
  7. {
  8.     return $form;
  9. }
  10.  
  11. public function indexAction()
  12. {
  13.    
  14.    
  15.      require_once APPLICATION_PATH . '/forms/Rej.php';
  16.    
  17.    
  18. }
  19.  
  20. }
  21. ?>



widok
  1. <h1 align="center">
  2. Rejestracja
  3.  
  4. <?= $this->form ?>
  5. </h1>


/forms/Rej.php


  1. <?php
  2. $form = new Zend_Form();
  3.  
  4. $form->setAction('rej/wys');
  5. $form->setMethod('post');
  6.  
  7. //tworzenie nowego pola username
  8. $username=$form->createElement('text','username');
  9.  
  10.  
  11. // Tworzenie nowego pola password
  12.  
  13. $password=$form->createElement('password','password');
  14.  
  15. $form->addElement($username)->addElement($password)->addElement('submit','login');
  16. ?>


Bardzo bym prosił o pokazanie co robię zle ze formularz mi się nie pokazuje (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Posty w temacie


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: 20.12.2025 - 20:10