Cytat(qba_rox @ 16.01.2009, 13:04:39 )

sprawdz czy nie wywolujesz <?= $this->headScript() ?> 2 razy, akcja nie jest wykonywana 2 razy albo czy twoj widok nie jest renderowany dwa razy

Zauważyłem, że problem występuje wtedy, gdy choć raz odwołam się do View Helper, który mam zdefiniowany następująco:
views/helpers/Acl.php<?php
class Alt_View_Helper_Acl extends Zend_View_Helper_Abstract
{
public function Acl($controller, $action)
{
$acl = Zend_Registry::get('acl');
$auth = Zend_Auth::getInstance();
if (!$auth->hasIdentity()) return false;
$role = $auth->getStorage()->read()->role;
return $acl->isAllowed($role, $controller, $action);
}
}
?>
bootstrap.php<?php
or
define('APPLICATION_ENVIRONMENT', 'development');
$frontController = Zend_Controller_Front::getInstance();
$frontController->setControllerDirectory(APPLICATION_PATH . '/controllers');
$frontController->setParam('env', APPLICATION_ENVIRONMENT);
Zend_Layout::startMvc(APPLICATION_PATH . '/layouts/scripts');
$view = Zend_Layout::getMvcInstance()->getView();
$view->doctype('XHTML1_STRICT');
$view->addHelperPath('views/helpers/', 'Alt_View_Helper');
$configuration = new Zend_Config_Ini(APPLICATION_PATH . '/config/app.ini', APPLICATION_ENVIRONMENT);
$dbAdapter = Zend_Db::factory($configuration->database);
$dbAdapter->query('SET NAMES utf8');
Zend_Db_Table_Abstract::setDefaultAdapter($dbAdapter);
require_once APPLICATION_PATH . '/models/Acl.php';
require_once APPLICATION_PATH . '/models/Auth.php';
$auth = Zend_Auth::getInstance();
$acl = new Acl($auth);
$frontController->registerPlugin(new Auth($auth, $acl))
->setParam('auth', $auth);
$registry = Zend_Registry::getInstance();
$registry->configuration = $configuration;
$registry->dbAdapter = $dbAdapter;
$registry->acl = $acl;
unset($frontController, $view, $configuration, $dbAdapter, $registry); ?>
Ktoś widzi przyczynę?