Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

请问下,您上传的这份代码是否有问题 #2

Closed
Imagle opened this issue Jun 21, 2015 · 2 comments
Closed

请问下,您上传的这份代码是否有问题 #2

Imagle opened this issue Jun 21, 2015 · 2 comments

Comments

@Imagle
Copy link

Imagle commented Jun 21, 2015

请问下,您上传的这份代码是否有问题?
为什么没有module目录,并且看您也定义了两个module(index, admin).
我把环境搭好后,所有页面使用默认路由方式都最后到了indexController的indexAction了,不知道是为什么?
访问 domain.com/item/test,打印出$dispatcher, 部分结果如下:
object(Yaf_Router)[5]
protected '_routes' =>
array
'_default' =>
object(Yaf_Route_Static)[6]
...
'supervar' =>
object(Yaf_Route_Supervar)[10]
...
'simple' =>
object(Yaf_Route_Simple)[11]
...
protected '_current' => null
protected '_view' => null
protected '_request' =>
object(Yaf_Request_Http)[3]
public 'module' => null
public 'controller' => null
public 'action' => null
public 'method' => string 'GET' (length=3)
protected 'params' =>
array
empty
protected 'language' => null
protected '_exception' => null
protected '_base_uri' => string '/index.php' (length=10)
protected 'uri' => string '/index.php' (length=10)
protected 'dispatched' => boolean false
protected 'routed' => boolean false

@Imagle
Copy link
Author

Imagle commented Jun 21, 2015

发现 默认路由 不能正确的工作。使用 Yaf_Route_Simple 这个就可以。现在查不出来为啥默认路由不能正常工作。

@Imagle
Copy link
Author

Imagle commented Jun 22, 2015

已解决,是因为nginx里面的配置 fastcgi_param PATH_INFO必须得去掉,不然rewrite不能生效,导致默认路由协议不能正常工作。

@Imagle Imagle closed this as completed Jun 22, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant