benim denetleyicisi böyle bir paginator örneğini oluşturduk:
// On crée un objet paginator pour afficher un tableau de résultat.
$paginator = Zend_Paginator::factory($versions->getVersions($projectId));
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(15);
Sonra böyle benim görüşüme üzerinde yineleme:
<? foreach ($this->paginator as $item): ?>
<? ($flag == "pair") ? $flag = "impair" : $flag = "pair"; ?>
<tr class="<?= $flag; ?>">
<!-- version nom de la version -->
<td>
<a href="<?= $this->url(array('module' => "admin", 'controller' => "version", 'action' => "index", 'project' => $item['idversion'])); ?>">
<?= $item['lab_version']; ?>
</a>
</td>
<!-- version nom du project -->
<td><?= $item['name_patrimony']; ?></td>
<!-- version retrodocumente ? -->
<td class="version-retrodoc">
<a href="<?= $this->url(array("module" => "doxygen", "controller" => "doxygen", "action" => "create", "version" => $item['idversion']), null, true); ?>">
<img src="<?= $this->baseUrl() . '/img/system-run.png' ?>" alt="retrodocumenté"/>
</a>
</td>
</tr>
<? endforeach; ?>
But in my controller I would handle some conditions. My paginator instance is a collection of version of project. So I would handle if the home directory has been correctly created if the information about the version is correctly inserted in the db... All that are checking in the controller. My goal is to add these variables (most of the times boolean) and add it to paginator instance so then I would iterate over it in the view and add message error.
PS: Birisi nasıl Stackoverflow doğru php kodunu biçimlendirmek için söyle olsaydı yararlı :-) olacaktır.