Précédent   Forum des professionnels en informatique > PHP > Outils > Zend > Zend Framework
Zend Framework Forum d'entraide sur la programmation PHP avec Zend Framework. Avant de poster -> FAQ ZF, Cours ZF
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 16/11/2010, 15h33   #1
Nouveau Membre du Club
 
Inscription : mars 2009
Messages : 90
Détails du profil
Informations forums :
Inscription : mars 2009
Messages : 90
Points : 34
Points : 34
Par défaut function indexAction => Page blanche

Bonjour à Tous,

Je suis bloqué sur le tutoriel de ZF. J'obtiens une page blanche au niveau de l'index dès que j'inclus ceci dans controllers/IndexController.php:

Code :

Code :
1
2
3
4
5
6
7
function indexAction()
	{
	$this->view->title = "Mes Albums";
        $this->view->headTitle($this->view->title, 'PREPEND');
        $albums = new Model_DbTable_Albums();
        $this->view->albums = $albums->fetchAll();
	}
Une idée svp ?

Merci
NeoGeoo est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/11/2010, 15h57   #2
Membre chevronné
 
Homme Taoufiq Ben
Développeur Web
Inscription : mai 2009
Messages : 453
Détails du profil
Informations personnelles :
Nom : Homme Taoufiq Ben
Âge : 25
Localisation : Maroc

Informations professionnelles :
Activité : Développeur Web
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : mai 2009
Messages : 453
Points : 639
Points : 639
est ce que tu met function ou public function
m4riachi est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/11/2010, 16h35   #3
Nouveau Membre du Club
 
Inscription : mars 2009
Messages : 90
Détails du profil
Informations forums :
Inscription : mars 2009
Messages : 90
Points : 34
Points : 34
Citation:
Envoyé par m4riachi Voir le message
est ce que tu met function ou public function
Oui, au fait c'est cette ligne qui cause la page blanche :
Code :
$this->view->albums = $albums->fetchAll();
- une idée ?
- si il y a une erreur , pkoi elle ne s'affiche pas ? (display_errors = On dans php.ini)
NeoGeoo est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/11/2010, 16h37   #4
Membre chevronné
 
Inscription : juillet 2003
Messages : 625
Détails du profil
Informations forums :
Inscription : juillet 2003
Messages : 625
Points : 600
Points : 600
Bonjour, un var_dump($albums) te donne quoi ?
__________________
Le savoir est utile que s'il est partagé par tous.
/(bb|[^b]{2})/
!sleep() ? array((string))
syl2095 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/11/2010, 17h38   #5
Nouveau Membre du Club
 
Inscription : mars 2009
Messages : 90
Détails du profil
Informations forums :
Inscription : mars 2009
Messages : 90
Points : 34
Points : 34
Citation:
Envoyé par syl2095 Voir le message
Bonjour, un var_dump($albums) te donne quoi ?
Bonjour,

Code :
1
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
object(Model_DbTable_Albums)#42 (18) {
["_name":protected]=> string(6) "albums" 
["_definition":protected]=> NULL 
["_definitionConfigName":protected]=> NULL 
["_db":protected]=> object(Zend_Db_Adapter_Pdo_Mysql)#33 (12) { 
["_pdoType":protected]=> string(5) "mysql" 
["_numericDataTypes":protected]=> array(16) { [0]=> int(0) [1]=> int(1) [2]=> int(2) 
["INT"]=> int(0) 
["INTEGER"]=> int(0) 
["MEDIUMINT"]=> int(0) 
["SMALLINT"]=> int(0) 
["TINYINT"]=> int(0) 
["BIGINT"]=> int(1) 
["SERIAL"]=> int(1) 
["DEC"]=> int(2) 
["DECIMAL"]=> int(2) 
["DOUBLE"]=> int(2) 
["DOUBLE PRECISION"]=> int(2) 
["FIXED"]=> int(2) 
["FLOAT"]=> int(2) } 
["_defaultStmtClass":protected]=> string(21) "Zend_Db_Statement_Pdo" 
["_config":protected]=> array(8) { 
["host"]=> string(9) "localhost" 
["username"]=> string(4) "toto" 
["password"]=> string(4) "titi" 
["dbname"]=> string(11) "tutoriel-db" 
["charset"]=> NULL 
["persistent"]=> bool(false) 
["options"]=> array(3) { 
["caseFolding"]=> int(0) 
["autoQuoteIdentifiers"]=> bool(true) 
["fetchMode"]=> int(2) } 
["driver_options"]=> array(0) { } } 
["_fetchMode":protected]=> int(2) 
["_profiler":protected]=> object(Zend_Db_Profiler)#34 (4) { 
["_queryProfiles":protected]=> array(0) { } 
["_enabled":protected]=> bool(false) 
["_filterElapsedSecs":protected]=> NULL 
["_filterTypes":protected]=> NULL } 
["_defaultProfilerClass":protected]=> string(16) "Zend_Db_Profiler" 
["_connection":protected]=> NULL 
["_caseFolding":protected]=> int(0) 
["_autoQuoteIdentifiers":protected]=> bool(true) 
["_allowSerialization":protected]=> bool(true) 
["_autoReconnectOnUnserialize":protected]=> bool(false) } 
["_schema":protected]=> NULL 
["_cols":protected]=> NULL 
["_primary":protected]=> NULL 
["_identity":protected]=> int(1) 
["_sequence":protected]=> bool(true) 
["_metadata":protected]=> array(0) { } 
["_metadataCache":protected]=> NULL 
["_metadataCacheInClass":protected]=> bool(true) 
["_rowClass":protected]=> string(17) "Zend_Db_Table_Row" 
["_rowsetClass":protected]=> string(20) "Zend_Db_Table_Rowset" 
["_referenceMap":protected]=> array(0) { } 
["_dependentTables":protected]=> array(0) { } 
["_defaultSource":protected]=> string(11) "defaultNone" 
["_defaultValues":protected]=> array(0) { } }
(je maintient la ligne qui pose problème commentée)
NeoGeoo est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/11/2010, 17h44   #6
Membre chevronné
 
Inscription : juillet 2003
Messages : 625
Détails du profil
Informations forums :
Inscription : juillet 2003
Messages : 625
Points : 600
Points : 600
et var_dump($albums->fetchAll()) ?

sinon tu as l'abro /view/index/index.phtml ?

dans index.phtml tu as quoi ?
__________________
Le savoir est utile que s'il est partagé par tous.
/(bb|[^b]{2})/
!sleep() ? array((string))
syl2095 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/11/2010, 18h02   #7
Nouveau Membre du Club
 
Inscription : mars 2009
Messages : 90
Détails du profil
Informations forums :
Inscription : mars 2009
Messages : 90
Points : 34
Points : 34
Citation:
Envoyé par syl2095 Voir le message
et var_dump($albums->fetchAll()) ?
sinon tu as l'abro /view/index/index.phtml ?
dans index.phtml tu as quoi ?
dans views\script\index\index.phtml :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<p><a href="<?php echo $this->url(array('controller'=>'index',
        'action'=>'ajouter'));?>">Ajouter de nouveaux albums</a></p>
<table>
    <tr>
        <th>Titre</th>
        <th>Artiste</th>
        <th>&nbsp;</th>
    </tr>
<?php foreach($this->albums as $album) : ?>
    <tr>
        <td><?php echo $this->escape($album->titre);?></td>
        <td><?php echo $this->escape($album->artiste);?></td>
        <td>
            <a href="<?php echo $this->url(array('controller'=>'index',
                'action'=>'modifier', 'id'=>$album->id));?>">Modifier</a>
            <a href="<?php echo $this->url(array('controller'=>'index',
                'action'=>'supprimer', 'id'=>$album->id));?>">Supprimer</a>
        </td>
    </tr>
<?php endforeach; ?>
</table>
NeoGeoo est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 17/11/2010, 16h24   #8
Nouveau Membre du Club
 
Inscription : mars 2009
Messages : 90
Détails du profil
Informations forums :
Inscription : mars 2009
Messages : 90
Points : 34
Points : 34
J'ai la solution

http://coreygilmore.com/blog/2009/11...ng-on-windows/

Sur WINDOWS 7 : il faut retoucher le fichier : \system32\drivers\etc\hosts
==> Décommenter la ligne # 127.0.0.1 localhost

Je pense que bcp auront le même problème.
NeoGeoo est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 15h16.


 
 
 
 
Partenaires

Hébergement Web