zend-controller

Zend Framework - Set No Layout for Controller

荒凉一梦 提交于 2019-12-04 18:03:13
问题 I have a Controller that I want to use for ajax scripts to call and set session variables, get information, etc. How do I set it so that that particular controller doesn't use the default layout (specifically NO layout) so that it can send XML/JSON messages back and forth? 回答1: Like anything to do with Zend_Framework and Zend_Application, there are multiple ways to do this, but on the last few pure Zend gigs I've done, I've seen people using the following (from an action method in you

Control access to files available for download

痴心易碎 提交于 2019-12-01 01:21:18
I have a folder that contains uploaded documents that my ZF application can spit out to logged in users. I want them to be able to use a link like http://server/documents/filename.pdf and download the file, but I want to have a controller DocumentsController that enables the existing user cookies to verify that they are logged in and have permission to download the file. I don't want to have to use URLs like http://server/documents/index/id/1 if I don't have to, though its not a terrible option. You can use X-SendFile to obtain the best performance. It is supported by Apache (mod_xsendfile),