dostałem aplikację, w której nie wiem dlaczego ale nie widzi nowej dodanej akcji/widoku.
Dostaję taki komunikat "Action Helper by name xxxxxAction not found"
Pewnie chodzi o ścieżki route, ale nie wiem gdzie są zdefiniowane.
Plik index.php
<?php . PATH_SEPARATOR . ROOT_PATH . '/library' . PATH_SEPARATOR . ROOT_PATH . '/application/default/models/' ); require_once 'Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->setFallbackAutoloader(true); try { $frontend = array('master_file' => ROOT_PATH . '/config/route.ini', 'automatic_serialization' => true); $cache = Zend_Cache::factory('File', 'File', $frontend, $backend); if (!$config = $cache->load('route')) { $config = new Zend_Config_Ini(ROOT_PATH . '/config/route.ini', 'routes'); $cache->save($config, 'route'); } require_once 'Core/Controller/Plugin/Cache.php'; $router = new Core_Controller_Router_Rewrite(); $router->addConfig($config, 'route'); $fc = Zend_Controller_Front::getInstance(); $fc->throwExceptions(true); $fc->setParam('noViewRenderer', true); $fc->setRouter($router); $fc->addModuleDirectory(ROOT_PATH . '/application'); $fc->registerPlugin(new Core_Controller_Plugin_Locale()); $fc->registerPlugin(new Core_Controller_Plugin_Runtime()); $fc->registerPlugin(new Core_Controller_Plugin_Acl()); $fc->registerPlugin(new Core_Controller_Plugin_Layout()); $fc->dispatch(); } catch (Exception $e) { }
route.ini
Kod
; ================= trasy statyczne ============================================
route.error403.type = "Zend_Controller_Router_Route_Static"
route.error403.route = "nie_masz_dostepu"
route.error403.defaults.module = default
route.error403.defaults.controller = error
route.error403.defaults.action = display
route.error403.defaults.code = 403
route.error403.type = "Zend_Controller_Router_Route_Static"
route.error403.route = "nie_masz_dostepu"
route.error403.defaults.module = default
route.error403.defaults.controller = error
route.error403.defaults.action = display
route.error403.defaults.code = 403
Jeszcze są dwa takie pliczki:
rewrite.php
final class Core_Controller_Router_Rewrite extends Zend_Controller_Router_Rewrite { public function addDefaultRoutes() { if (!$this->hasRoute('default')) { $dispatcher = $this->getFrontController()->getDispatcher(); $request = $this->getFrontController()->getRequest(); } } }
rote.php
final class Core_Controller_Router_Route_Module extends Zend_Controller_Router_Route_Module { protected $_languageKey = 'language'; public function match($path) { $this->_setRequestKeys(); if ($path != '') { } if ($this->_dispatcher && $this->_dispatcher->isValidModule($path[0])) { $this->_moduleValid = true; } } } for ($i = 0; $i < $numSegs; $i = $i + 2) { $params[$key] = $val; } } } $this->_values = $values + $params; return $this->_values + $this->_defaults; } { if (!$this->_keysSet) { $this->_setRequestKeys(); } foreach ($data as $key => $value) { if ($value !== null) { $params[$key] = $value; } } $params += $this->_defaults; $url = ''; $lang = $params[$this->_languageKey]; if ($params[$this->_moduleKey] != $this->_defaults[$this->_moduleKey]) { $module = $params[$this->_moduleKey]; } } $controller = $params[$this->_controllerKey]; $action = $params[$this->_actionKey]; foreach ($params as $key => $value) { $url .= '/' . $key; $url .= '/' . $value; } $url = '/' . $action . $url; } $url = '/' . $controller . $url; } $url = '/' . $module . $url; } $url = '/' . $lang . $url; } }