Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] layout i zend_form
kociupk
post
Post #1





Grupa: Zarejestrowani
Postów: 97
Pomógł: 1
Dołączył: 29.03.2006

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


zastanawiam sie jak przekazac formularz do layout, odebrac dane i sprawdzic czu uzytkownik jest zalogowany

mam plik indexController ktory przekazuje formularz do helpera
  1. class IndexController extends Zend_Controller_Action
  2. {
  3. function init()
  4. {
  5. $form = new App_Form_Login();
  6. $helper= $this->_helper->getHelper('formlogin');
  7. $helper->formlogin($form);
  8. }
  9. }

plik helper FormLogin

  1. class Zend_View_Helper_FormLogin extends Zend_View_Helper_Abstract
  2. {
  3. private $form;
  4.  
  5. public function formlogin($form)
  6. {
  7. return $form;
  8. }
  9. }

plik bootstrap
  1. protected function _initViewHelper()
  2. {
  3. $this->bootstrap('layout');
  4. $layout = $this->getResource('layout');
  5. $view = $layout->getView();
  6.  
  7. $form = new Zend_View_Helper_FormLogin();
  8. $view = $form->formlogin();
  9. }

nie wiem czy to dziala wszystko pisane z palca chce sie dowiedziec czy mam dobry tok myslenia czy to tak ma mniej wiecej wygladac

Ten post edytował kociupk 10.04.2010, 14:18:51
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
kociupk
post
Post #2





Grupa: Zarejestrowani
Postów: 97
Pomógł: 1
Dołączył: 29.03.2006

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


darko tyle to wiem wytlumacze to innaczej chce dodac formularz po za <?php echo $this->layout()->content ?>

  1. <?php echo $this->doctype() ?>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Zend Framework Quickstart Application</title>
  5. <?php echo $this->headLink()->appendStylesheet('/css/global.css') ?>
  6. </head>
  7. <div>np. tutaj chce dodac formularz logowania </div>
  8. </div>
  9.  
  10. <?php echo $this->layout()->content ?>
  11.  
  12. </body>
  13. </html>
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: 3.10.2025 - 19:19