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

Autres composants PHP Discussion :

pb avec zend paginator


Sujet :

Autres composants PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre actif
    Femme Profil pro
    Inscrit en
    Avril 2012
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Femme

    Informations forums :
    Inscription : Avril 2012
    Messages : 57
    Par défaut pb avec zend paginator
    Bonjour,
    J'ai crée un zend paginator, mais quand je clisue sur suivant il m'affiche la page suivante mais sans css.pouvez vous m'aider s'il vous plait?

    Merci.

  2. #2
    Membre émérite
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mai 2009
    Messages
    736
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : Maroc

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

    Informations forums :
    Inscription : Mai 2009
    Messages : 736
    Par défaut
    affiche le code

  3. #3
    Membre actif
    Femme Profil pro
    Inscrit en
    Avril 2012
    Messages
    57
    Détails du profil
    Informations personnelles :
    Sexe : Femme

    Informations forums :
    Inscription : Avril 2012
    Messages : 57
    Par défaut
    Bonjour,
    voilà le code:
    1/
    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
    cote controller:
    class UtilisateurController extends Zend_Controller_Action
    {
     
        public function init()
        {
            /* Initialize action controller here */
        }
     
        public function indexAction()
        {
     
        	Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
        	$db= Zend_Db_Table::getDefaultAdapter();
        	$select = $db->select()->from('utilisateur')                    ;
    		$paginator = Zend_Paginator::factory($select);
            $paginator->setCurrentPageNumber($this->_getParam('page',1)); 
            $paginator->setItemCountPerPage(2);
    		$this->view->paginator = $paginator;	
        }}

    2/script pagination:
    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
    25
    26
    27
    28
    29
    30
    31
    32
    <?php if ($this->pageCount): ?>
    <div class="paginationControl">
    <!-- Previous page link -->
    <?php if (isset($this->previous)): ?>
      <a href="<?php echo $this->url(array('page' => $this->previous)); ?>">  
        &lt; Previous
      </a> |
    <?php else: ?>
      <span class="disabled">&lt; Previous</span> |
    <?php endif; ?>
     
    <!-- Numbered page links -->
    <?php foreach ($this->pagesInRange as $page): ?>
      <?php if ($page != $this->current): ?>
        <a href="<?php echo $this->url(array('page' => $page)); ?>">
            <?php echo $page; ?>
        </a> |
      <?php else: ?>
        <?php echo $page; ?> |
      <?php endif; ?>
    <?php endforeach; ?>
     
    <!-- Next page link -->
    <?php if (isset($this->next)): ?>
      <a href="<?php echo $this->url(array('page' => $this->next)); ?>">
        Next &gt;
      </a>
    <?php else: ?>
      <span class="disabled">Next &gt;</span>
    <?php endif; ?>
    </div>
    <?php endif; ?>

    coté view:
    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
    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
     
    <table class="display data_table3 dataTable" id="data_table3" aria-describedby="data_table3_info">
                                    <thead>
                                      <tr role="row">
    	                                  <th width="35" class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 33px; " aria-label="&lt;input type=&quot;checkbox&quot; id=&quot;checkAll&quot; class=&quot;checkAll&quot;&gt;">
    		                                  <div class="custom-checkbox"><input type="checkbox" id="checkAll" class="checkAll">
    		                                  		<label for="checkAll" class="checker" style="left: 3px; "></label>
    		                                  </div>
    	                                  </th>
     
    	                                  <th width="199"  align="left" class="sorting_asc" role="columnheader" tabindex="0" aria-controls="data_table3" rowspan="1" colspan="1" style="width: 100px; " aria-sort="ascending" aria-label="Name: activate to sort column descending">Nom </th>
    									  <th  width="199" class="sorting" role="columnheader" tabindex="0" aria-controls="data_table3" rowspan="1" colspan="1" style="width: 100px; " aria-label="Show ID: activate to sort column ascending">Identifiant</th>
    	                                  <th  width="199" class="sorting" role="columnheader" tabindex="0" aria-controls="data_table3" rowspan="1" colspan="1" style="width: 100px; " aria-label="Show ID: activate to sort column ascending">Groupe</th>
    	                                  <th  width="199" class="sorting" role="columnheader" tabindex="0" aria-controls="data_table3" rowspan="1" colspan="1" style="width: 100px; " aria-label="Show ID: activate to sort column ascending">Active</th>
    	                                  <th  width="199" class="sorting" role="columnheader" tabindex="0" aria-controls="data_table3" rowspan="1" colspan="1" style="width: 227px; " aria-label="Show ID: activate to sort column ascending">Date d'enregistrement</th>
    	                                  <th width="199" class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 187px; " aria-label="Management">Action</th>
    	                             </tr>
                                    </thead>
     
                                  <tbody role="alert" aria-live="polite" aria-relevant="all">        
                                  		<?php  foreach($this->paginator as $record)  {?>
    					                    <tr class="odd">
    					                        <td width="35" class=" "><div class="custom-checkbox"><input type="checkbox" id="check11" class="chkbox" name="checkbox[]"><label class="checker" for="check11" style="left: 3px;"></label></div></td>
    											<td  class=" " align="left"><?php echo $record['nom'];?></td>
    					      					<td class=" "><?php echo $record['login'];?></td>
    											<td class=" "><?php echo $record['groupe'];?></td>
    					                        <td class=" "><?php  $activ = $record['active'];
    					                                   if($activ==1){echo'<a class="grid_true"></a>';}
    					                                   else{echo '<a class="grid_false"></a>';} ?></td>
    					                        <td class=" "> <?php echo $record['date_enregistrement'];?></td>
    					                        <td class=" "><span class="tip"><a  title="Edit" href="<?php  echo $this->url(array('controller'=>'utilisateur', 'action'=>'edit', 'id'=>$record['id'])); ?>"><img src="images/icon_edit.png" ></a></span> <span class="tip" ><a title="Delete" href="<?php echo $this->url(array('controller'=>'utilisateur', 'action'=>'supprimer', 'id'=>$record['id'])); ?>"><img src="images/icon_delete.png" ></a>  </span>
    					                         </tr>      
    					               <?php  }?> 
     
     
    		                      </tbody>
    		              </table>	
                        </li>
                          </ul>
     
    				<div class="action_bar">
                        <div class="content_pad text_center">
     
                                    <ul class="pagination"> 
                                       <li>
    										    <?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>
    									</li>
     
                                   </ul>
                        </div>
    Merci.

  4. #4
    Membre émérite
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mai 2009
    Messages
    736
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : Maroc

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

    Informations forums :
    Inscription : Mai 2009
    Messages : 736
    Par défaut
    Le jour où tu auras du temps tu doit voir pourquoi ça ne marche pas, normalement ça devrais marcher sans rappelle du css.
    Si tu peux faire afficher le layout.phtml ou le fichier où tu appelle le css pour la première fois.

Discussions similaires

  1. comment réaliser une pagination avec zend
    Par aziza_1989 dans le forum Autres composants
    Réponses: 3
    Dernier message: 04/06/2012, 18h37
  2. pagination des données avec zend
    Par Invité dans le forum Zend Framework
    Réponses: 1
    Dernier message: 18/05/2011, 22h02
  3. Problème avec la pagination
    Par Vlacar dans le forum ASP
    Réponses: 4
    Dernier message: 25/02/2007, 18h20
  4. problème d'actualisation avec la pagination
    Par momov dans le forum ASP
    Réponses: 10
    Dernier message: 03/07/2006, 14h33
  5. Réponses: 8
    Dernier message: 20/01/2006, 13h46

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