does not exist and was not trapped in __call()
Bonjour,
J'ai l'erreur lorsque je tape http://localhost/monsite/visuels
Code:
1 2
|
Fatal error: Uncaught exception 'Zend_Controller_Action_Exception' with message 'Action "visuels" does not exist and was not trapped in __call()' in /home/www/_lib/zend_v1.5.1/Zend/Controller/Action.php:477 |
Voici mon controller
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 25 26 27 28 29 30
|
<?php
require_once(APPLICATION_PATH.'/views/smarty/smarty_setup.php');
require_once(APPLICATION_PATH.'/models/MonTvModel.php');
class VisuelController extends Zend_Controller_Action
{
private $acl = null;
private $model = null;
private $config = null;
public function indexAction()
{
// Désactive autorendering pour cette action & active Smarty
$this->_helper->viewRenderer->setNoRender();
$visuels = $this->model->getList();
$smarty = new my_Smarty();
$smarty->assign('rights', $this->rights);
$smarty->assign('visuels', $visuels);
$smarty->display('visuel_list.tpl');
$this->_redirect('/monsite/visuels');
}
}
?> |
mon model
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
<?php
class Visuel
{
private /* Zend_Config_Ini */ $config = null;
private /* Zend_Db_Adapter */ $db = null;
private /* Zend_Log */ $log = null;
function getList(/* void */)
{
$data = $this->db->fetchAll('SELECT * FROM visuels ORDER BY special, id ASC');
return /* Array */ $data;
}
}
?> |
et mon view
Code:
1 2 3 4 5 6 7 8
|
{foreach from=$visuels item=visuels}
<tr>
<td width="300" align="left"><a href="/visuel/edit?id={$visuel.id}">{$visuel.name}</a></td>
<td width="400" align="left">{$visuel.exports}</td>
<td width="400" align="left">{$visuel.fichiers}</td>
</tr>
{/foreach} |
merci d'avance de votre réponse.
Pas d'action visuels dans le controlleur
Bonjour,
__call() est appelée si la méthode invoquée n'existe pas.
J'imagine qu'il faut créer une méthode visuelsAction() au sein du controlleur