Précédent   Forum des professionnels en informatique > PHP > Outils > Zend > Zend Framework > MVC
MVC Forum de support sur le développement d'applications de type modèle-vue-contrôleur avec Zend Framework ainsi que vos questions sur les plugins, les helpers etc. Avant de poster -> Cours MVC, FAQ ZF Controller
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 15/03/2011, 15h06   #1
Membre à l'essai
 
Inscription : avril 2008
Messages : 140
Détails du profil
Informations forums :
Inscription : avril 2008
Messages : 140
Points : 21
Points : 21
Par défaut Problème dans la view(affichage calendrier)

Bonjour ,mon problème c'est que j'essaie d'afficher un calendrier dans ma view
mais rien ne s'affiche.

voici mon fichier calendrier.phtml
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
<div id="calendrier">
<div class="calendrier_div_mois_entete">
	<div class="calendrier_mois_en_cours">
		<span class="linkcalendrier"><a href="ajaxaffiche?month=<?php echo $this->monthnb - 1; ?>&year=<?php echo $this->year; ?>"><<</a></span>
		<span><?php echo($this->month.' '.$this->year);  ?><?php echo($this->month.' '.$this->year);  ?></span>
		<span class="linkcalendrier"><a href="ajaxaffiche?month=<?php echo $this->monthnb + 1; ?>&year=<?php echo $this->year; ?>">>></a></span>
	</div>
	<div class="calendrier_div_les_jours">
		<?php for($i = 1; $i <= 7; $i++){?>
     		<span class="calendrier_span_jours_mois"><?php echo $this->daytab[$i];?></span>
     	<?php }?>	
	</div>
</div>
	<div class="calendrier_div_mois_contenu">
	<?php for($i = 1; $i <= count($this->calendar); $i++) {?>
                <span>
                <?php for($j = 1; $j <= 7 && $j-$this->firstday+1+(($i*7)-7) <= $this->nbdays; $j++){
                    if($j-$this->firstday+1+(($i*7)-7) == date("j") && $this->monthnb == date("n") && $this->year == date("Y")) { ?> <span class="current" style="width:107px;height:50px;background-color:silver;"><span style="width:40px;height:20px;background-color:white;float:left;margin-top:-20px;" id="calendrier"><?php echo $this->calendar[$i][$j];?></span></span>
                    <?php } else { ?><span style="width:107px;height:50px;background-color:silver;"><span style="width:40px;height:20px;background-color:white;float:left;margin-top:-20px;"><?php echo $this->calendar[$i][$j];?></span></span>
                <?php } }?>	
                </span>
    <?php }?> 
	</div>
</div>

Aidez moi svp!!!
sajodia est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/03/2011, 16h32   #2
Membre habitué
 
Avatar de Seelass
 
Homme
Étudiant
Inscription : décembre 2008
Messages : 112
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Mayenne (Pays de la Loire)

Informations professionnelles :
Activité : Étudiant
Secteur : Industrie

Informations forums :
Inscription : décembre 2008
Messages : 112
Points : 114
Points : 114
Bonjour,

Est-ce que tu vas fais appel à la méthode render de Zend_View() dans ton script du contrôleur?

Si ce n'est pas le cas voici un lien sur Zend_View comment doit-on l'utiliser?
__________________
Un proverbe africain dit : "La vitesse dont vous courrez dépend de la taille du chien qui vous poursuit"
Seelass est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/03/2011, 17h33   #3
Modérateur
 
Avatar de s.n.a.f.u
 
Homme
Développeur Web
Inscription : août 2006
Messages : 2 700
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 37
Localisation : France, Loire Atlantique (Pays de la Loire)

Informations professionnelles :
Activité : Développeur Web

Informations forums :
Inscription : août 2006
Messages : 2 700
Points : 3 357
Points : 3 357
Et au passage, il existe une syntaxe alternative de php très pratique pour faire du code lisible dans les vues :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
 
<?php for($i = 1; $i <= count($this->calendar); $i++): ?>
    <span>
    <?php for($j = 1; $j <= 7 && $j-$this->firstday+1+(($i*7)-7) <= $this->nbdays; $j++): ?>
        <?php if($j-$this->firstday+1+(($i*7)-7) == date("j") && $this->monthnb == date("n") && $this->year == date("Y")): ?>
            <span class="current" style="width:107px;height:50px;background-color:silver;">
                <span style="width:40px;height:20px;background-color:white;float:left;margin-top:-20px;" id="calendrier">
                    <?php echo $this->calendar[$i][$j];?>
                </span>
            </span>
        <?php else: ?>
            <span style="width:107px;height:50px;background-color:silver;">
                <span style="width:40px;height:20px;background-color:white;float:left;margin-top:-20px;">
                    <?php echo $this->calendar[$i][$j];?>
                </span>
            </span>
        <?php endif ?>
    <?php endfor ?> 
    </span>
<?php endfor ?>
__________________
  • Avant de poser une question, n'hésitez pas à chercher dans la FAQ et les forums
  • Merci d'utiliser les balises de code (# dans l'éditeur)
  • Si votre problème est réglé, merci d'utiliser le bouton
S.N.A.F.U
s.n.a.f.u est déconnecté   Envoyer un message privé Réponse avec citation 10
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 21h26.


 
 
 
 
Partenaires

Hébergement Web