IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

MVC PHP Discussion :

Problème dans la view(affichage calendrier)


Sujet :

MVC PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Avril 2008
    Messages
    141
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 141
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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!!!

  2. #2
    Membre chevronné

    Homme Profil pro
    Développeur mobile iOS / Android
    Inscrit en
    Décembre 2008
    Messages
    259
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur mobile iOS / Android
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2008
    Messages : 259
    Par défaut
    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?
    « Il est assez difficile de trouver une erreur dans son code quand on la cherche. C’est encore bien plus dur quand on est convaincu que le code est juste. » - Steve McConnell

    N'oubliez pas de consulter les FAQ Swift, Android
    Tutoriel : Développer une application multilingue sous iOS

  3. #3
    Membre Expert
    Avatar de s.n.a.f.u
    Homme Profil pro
    Développeur Web
    Inscrit en
    Août 2006
    Messages
    2 760
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Août 2006
    Messages : 2 760
    Par défaut
    Et au passage, il existe une syntaxe alternative de php très pratique pour faire du code lisible dans les vues :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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 ?>

Discussions similaires

  1. [Struts] html:select problème dans l'affichage
    Par n00noors dans le forum Struts 1
    Réponses: 17
    Dernier message: 16/05/2006, 10h54
  2. Réponses: 3
    Dernier message: 29/04/2006, 22h06
  3. Réponses: 3
    Dernier message: 11/01/2006, 17h44
  4. problème dans l'affichage sur word (VB6)
    Par rupeni dans le forum VB 6 et antérieur
    Réponses: 3
    Dernier message: 23/11/2005, 12h40
  5. Réponses: 2
    Dernier message: 14/09/2005, 13h39

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo