簡體   English   中英

Zend應用程序模塊結構中的無效控制器類錯誤

[英]Invalid controller class error in Zend Application Module Structure

I use Zend framework.I want to do Zend Application Module Structure

When I open "http://localhost/aileTerapisi_z/public" I see Zend framework home page but
When I open "http://localhost/aileTerapisi_z/public/yonetim", it give me thiss eror:

Message: Invalid controller class ("Yonetim_IndexController")

[h=3]Request Parameters:[/h]
array ( 'module' => 'yonetim', 'controller' => 'index', 'action' => 'index', ) 

how do I resolve this error

My structure is this:

application
configs
application.ini
modules
yonetim
controllers
IndexController.php
models
views
helpers
scripts
index
index.phtml

default
controllers
IndexController.php
models
views
helpers
scripts
index
index.phtml

Bootstrap.php

library
public
.htaccess
index.php


My application/configs/application.ini file is like this:

[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 "/modules/default/controllers"
resources.frontController.controllerDirectory = APPLICATION_PATH "/modules/yonetim/controllers"
resources.frontController.params.displayExceptions = 1

autoloadernamespaces.0 = "App_"
autoloadernamespaces.1 = "Zend_"
autoloadernamespaces.2 = "ZendX_"

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.moduleControllerDirector yName = "controllers"

resources.frontController.env = APPLICATION_ENV
resources.frontController.throwerrors = false


resources.db.adapter = PDO_Mysql
resources.db.params.host =
resources.db.params.username =
resources.db.params.password =
resources.db.params.dbname =


;layoutpath
resources.layout.layout = "layout"
resources.layout.layoutPath = APPLICATION_PATH "/modules/default/views/layouts"
resources.layout.layoutPath = APPLICATION_PATH "/modules/yonetim/views/layouts"

[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
resources.frontcontroller.throwerrors = true 

Zend具有很好的錯誤控制。 從錯誤的外觀來看,您的Controller * Yonetim_IndexController.php *確實存在,但是在php文件中有一個類,其預期名稱類似於:

class .*YonetimController extends Zend_Controller_Action {
}

似乎丟失了-。*可能是任何字母。 如果您正在復制粘貼任何模板的其他Controller,而忘記更改類名,則可能會發生這種情況。

這是使用模塊結構的簡單application.ini。

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
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 = 0

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.layout.layout = default

resources.modules[] = ""
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

[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

您可以在以下文件結構中使用此配置。

application
    configs
    controllers
       IndexController.php
    layout
       scripts
           defalut.phtml
           yonetim.phtml
    models
    modules
         yonetim
               controoler
                    IndexController.php
               models
               views
                    helpers
                    scripts
                          index
                               index.phtml       

    views
          helpers
              scripts
                  index
                     index.phtml  

public
library

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM