
Walcze z Zendem od niedawna i mam taki oto problem:
Aplikacja jest modułowa, moduły mam w katalogu:
project/application/modules/
Akurat teraz mam jeden moduł: default a w nim kontrolery: Error, Index, User. Problem w tym, ze kontrolera User w ogóle mi nie widzi, tj. mam błąd 404, tak jakby nie było w ogóle linku. Ogólnie wygląda to tak, że jak wpisuje w przegladarke localhost/projekt/public/index to działa normalnie, jak zamienie index na user to juz nie chce chodzic.
Wszystkie akcje z kontrolera Index działają poprawnie, doctrine działa poprawnie. Plik htaccess standardowy, w katalogu public.

bootstrap wygląda u mnie tak:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { public function _initDoctrine() { $doctrineConfig = $this->getOption('doctrine'); $manager = Doctrine_Manager::getInstance(); $manager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true); $conn = Doctrine_Manager::connection($doctrineConfig['dsn'],'doctrine'); $conn->setAttribute(Doctrine_Core::ATTR_USE_NATIVE_ENUM, true); return $conn; } protected function _initViewHelpers() { $this->bootstrap('layout'); $layout = $this->getResource('layout'); $view = $layout->getView(); $view->doctype('HTML4_STRICT'); $view->headMeta()->appendHttpEquiv('Content-type','text/html;charset=utf-8'); $view->headTitle('QuIZ'); } protected function _initAutoLoad() { 'namespace' => '', 'basePath' => APPLICATION_PATH.'/modules/default' )); return $modelLoader; } }
application.ini
[production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "Application" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 1 resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.modules = "" resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" autoloaderNamespaces[] = "My_" autoloaderNamespaces[] = "Doctrine" doctrine.dsn = "mysql://root:owoc@localhost/quiz" doctrine.data_fixtures_path = APPLICATION_PATH "/../doctrine/data/fixtures" doctrine.models_path = APPLICATION_PATH "/models" doctrine.migrations_path = APPLICATION_PATH "/../doctrine/migrations" doctrine.sql_path = APPLICATION_PATH "/../doctrine/data/sql" doctrine.yaml_schema_path = APPLICATION_PATH "/../doctrine/schema" doctrine.generate_models_options.pearStyle = true doctrine.generate_models_options.generateTableClasses = true doctrine.generate_models_options.generateBaseClasses = true doctrine.generate_models_options.baseClassPrefix = "Base_" doctrine.generate_models_options.baseClassesDirectory = doctrine.generate_models_options.classPrefixFiles = false doctrine.generate_models_options.classPrefix = "Application_Model_" [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1
htaccess:
SetEnv APPLICATION_ENV development RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L]
usercontroller:
class UserController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ } public function indexAction() { // action body } }
Próbowałem z nazwą klasy UserController, np zmienić ją na Default_UserController ale to nic nie dało.
jeszcze do kompletu dodam plik index.php z katalogu /public
index.php
<?php // Define path to application directory // Define application environment // Ensure library/ is on include_path ))); /** Zend_Application */ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application->bootstrap() ->run();
Czyli jak widać też standard... Ma ktoś jakiś pomysł?
//EDIT -- problem rozwiązany, miałem wyłączony redirector w apachu...