开发者

Route to page in webroot folder? - CakePHP

How can I define a route to a .php file in my webroot folder?

Thank you

Edit:

How can I render a file in the webroot folder from a controller? I need this because I am using Auth开发者_开发技巧.


I'm guessing you're trying to password/Auth protect a file in the webroot folder. If so, you're on the wrong track. Files in the webroot are served as-is by default and are bypassing Cake entirely. Any file you put in the webroot is by definition "public". To protect it, you'll need to store it someplace else outside the webroot. You can then serve this file from a controller using the Media View. Your URL would look like, for example, /files/download/foo, which maps to FilesController::download('foo') via normal routes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜