今天把Zend Framework升级到了1.5.1最新版,发现有些连接访问出错,查官方文档发现是因为Action里面的“驼峰命名”方式的改变导致。
原来的情况是这样:假如我们有个 aaaBbbController::cccDddAction这么一个东西,访问的url可以是 /aaabbb/cccddd/ 也可以是 /aaaBbb/cccDdd/
现在的情况是这样:要么把方法写成 aaabbbController::cccdddAction 统一的小写,要么url里面改成这样 /aaa.bbb/ccc.ddd/ 或者 /aaa-bbb/ccc-ddd/
我还没有来得及搞明白这样改进的好处是什么。
官方文档:
7.13.1. Migrating from 1.0.x to 1.5.0 or newer
CamelCasedNamingConventions
官方提供了一个解决办法是:
$frontController->setParam(‘useCaseSensitiveActions’, true);
不过会产生一条E_USER_NOTICE级的错误信息,屏蔽掉就好.
详情请查看
Zend/Controller/Action.php中的dispatch方法
[Comment ID #26166 Will Be Quoted Here]
文档提供了三种方法,您说的那种方法被列为最佳、折中之后的第三种解决办法,还是不建议采用。
FleaPHP在这方面做得也不好,然后就在Qeephp中改进了下,文件名统一小写….
实在不知道哪里给你留言了呵呵
请教个问题
我现在用zf做项目,关于静态页面,你是怎么处理的?
我想要的是,能够直接访问静态页面,而不经过controller。
不知道你项目里是怎么用的,谢啦!
[Comment ID #29824 Will Be Quoted Here]
如果你要用纯粹的controller,可以配置服务器的rewrite规则,对于明确的.html等静态页面的url访问可以不进行rewrite到index.php,或者对于某些存放静态页面的特定目录不rewrite,这是唯一的办法。
另外,如果使用zf不使用它的controller机制,那就可以只把他当作类似pear的模块来使用,这样就不用都走index.php了。
Incredible a lot of valuable facts.
buy generic viagra
can you take viagra with wellbutrin – https://genericviagrarcp.com/
viagra component
generic viagra advanced canada LelandFLOOM f903_07
Hello! I could have sworn I’ve been to this site before but after checking through some of the post I realized it’s new
to me. Anyhow, I’m definitely delighted I found it and I’ll be bookmarking and checking back frequently!
I like what you guys tend to be up too. This kind of clever
work and coverage! Keep up the awesome works guys I’ve added you guys to my own blogroll.
bookmarked!!, I love your blog!
hello!,I really like your writing very so much!
proportion we be in contact more about your post on AOL?
I require an expert in this area to solve my problem.
Maybe that’s you! Having a look ahead to look you.
Hello, after reading this awesome piece of writing i am too glad to share
my knowledge here with colleagues.
constantly i used to read smaller posts which as well
clear their motive, and that is also happening with this paragraph which I am reading at this time.
Great beat ! I would like to apprentice while you amend your
website, how could i subscribe for a blog website?
The account helped me a acceptable deal. I had been tiny bit acquainted of this your
broadcast provided bright clear idea
Now I am ready to do my breakfast, later than having my breakfast coming
over again to read additional news.
This design is wicked! You obviously know how to keep a reader amused.
Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Excellent job.
I really loved what you had to say, and more than that, how you
presented it. Too cool!