-1

我去的时候收到这个错误

本地主机/应用程序/公共/面板/测试/索引

此应用程序有一个 sPanel 模块。里面有一个带有 indexAction() 的 TestController

这是 sPanel\config\module.config.php

<?php
return array(
    'controllers' => array(
        'invokables' => array(
            'sPanel\Controller\Test' => 'sPanel\Controller\TestController',
        ),
    ),
    'router' => array(
        'routes' => array(
            'spanel' => array(
                'type'    => 'segment',
                'options' => array(
                    'route'    => '/test[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'sPanel\Controller\Test',
                        'action'     => 'index',
                    ),
                ),
            ),
        ),
    ),
    'view_manager' => array(
        'template_path_stack' => array(
            'spanel' => __DIR__ . '/../view',
        ),
    ),
);
4

1 回答 1

3

首先,我强烈建议您开始使用虚拟主机来摆脱烦人的localhost/bla/public

其次,您尝试访问此路线:yourdomain/spanel/test/index,但没有迹象表明您/spanel在路线中的任何地方分配了该部分,您分配的只是/test[...]

所以简而言之,你想访问yourdomain/test/index或者你想修改你的路线以包含该/spanel部分

于 2013-10-31T12:14:55.457 回答