j'ai un souci avec une action de recherche.
j'ai essayer avec l'exemple fournit sur le site Zend Framework et j'ai un grand problème,j'arrive pas a récupérer mon array,das ma page HTML.
- Code: Select all
[lang=php]
public function rechercheAction()
{
Zend_Loader::loadClass('Zend_View');
$view = new Zend_View();
$view->setUseStreamWrapper(true);
$data = array(
array(
'auteur' => 'Hernando de Soto',
'titre' => 'Le mystère du capitalisme'
),
array(
'auteur' => 'Henry Hazlitt',
'titre' => 'Les sciences économique en un cours'
),
array(
'auteur' => 'Milton Friedman',
'titre' => 'Libre de choisir'
)
);
$this->view->books = $data;
$this->_redirect('?page_id=annonces');
}
Dans ma page HTML j'ai mis:
- Code: Select all
[lang=php]
?
<?php if ($this->books): ?>
<!-- La table des livres -->
<table>
<tr>
<th>Auteur</th>
<th>Titre</th>
</tr>
<?php foreach ($this->books as $key => $val): ?>
<tr>
<td><?php echo $this->escape($val['auteur']) ?></td>
<td><?php echo $this->escape($val['titre']) ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php else: ?>
<p>Aucun livre à afficher</p>
<?php endif; ?>
pourriez vous m'aider SVP
Merci d'avance pour vos repenses.

