Salut,
Je bosse sur le tuto zend framework mvc de Guillaume Rossolini
Tout marche bien sauf quand je veux ajouter un titre
en cliquant sur le lien Ajouter un nouvel album:
http://localhost/zf-tutorial/index/ajouter
Voila l'erreur que j'obtiens:
Fatal error: Call to a member function createRow() on a non-object in E:\htdocs\www\zf-tutorial\application\controllers\IndexController.php on line 44
Quelqu'un a t-il déjà eu cette erreur?
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33function ajouterAction() { $this->view->title = "Ajouter un nouvel album"; if ($this->_request->isPost()) { Zend_Loader::loadClass('Zend_Filter_StripTags'); $filter = new Zend_Filter_StripTags(); $artist = $filter->filter($this->_request->getPost('artist')); $artist = trim($artist); $title = trim($filter->filter($this->_request->getPost('title'))); if ($artist != '' && $title != '') { $data = array( 'artist' => $artist, 'title' => $title, ); $album = new Album(); $album->insert($data); $this->_redirect('/'); return; } } // set up an "empty" album $this->view->album = $album->createRow(); // <-- ligne 44 // additional view fields required by form $this->view->action = 'ajouter'; $this->view->buttonText = 'Ajouter'; }
Merci d'avance!

 

 
		
		 
         
 

 
			
			
 
   


 pb tuto zend mvc Call to a member function createRow() on a non-object
 pb tuto zend mvc Call to a member function createRow() on a non-object
				 Répondre avec citation
  Répondre avec citation


 
  
  
  
 
 
			 
   
 
 
						
Partager