Zend 框架问题 [英] Zend Framework Questions

查看:34
本文介绍了Zend 框架问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题.首先,我需要在我的网站上进行推荐.在 PHP 中它看起来像这样:www.mysite.com/join?ref=100 然后在页面上你会 $_get(ref);Zend 不喜欢这样,所以我该如何实现.

I have two questions. First, I am in need of having a referral in my site. In PHP it would look like this: www.mysite.com/join?ref=100 and then on the page you would $_get(ref); Zend does not like this, so how do I implement this.

第二个问题是如何使用框架在我的站点上拥有子域.我想在我的网站上放置一个论坛,并尝试了一个子域并加载了它,但它不起作用,因为 Zend 通过 index.php 推送所有内容.那么我如何让它存在于同一个站点上.我不能把它放在一个模块中,因为它本身就是一个站点.缺少使用另一个域,我被卡住了.

The second question is how can I have a subdomain on my site with the framework. I want to put a forum on my site, and tried a subdomain and loaded it, but it will not work as Zend pushes everything through the index.php. So how do I make it exist on the same site. I cannot put it in a module because it is a site within itself. Short of using another domain I am stuck.

感谢您的帮助.

推荐答案

对于您关于子域的第二个问题,似乎有三个问题:

For your second question about subdomains, there seem to be three issues:

  1. 网络级路由
  2. 应用级路由
  3. 模块结构

在网络级别,您将配置您的托管环境,以便所有子域都指向您的托管环境中的一个文件夹.然后在那里部署为标准 ZF 安装,包括标准 .htaccess.

At the network level, you would configure your hosting environment so that all the subdomains point to a single folder in your hosting environment. Then deploy as standard ZF installation there, including the standard .htaccess.

在应用级别,您的单个采埃孚安装将接收对您所有子域的请求.然后,您可以使用 ZF 的应用程序路由机制来处理这些请求.特别是,您可以配置各种 Zend_Controller_Router_Route_Hostname 路由以使用您选择的控制器/动作处理请求.

At the app level, your single ZF install will be receiving requests for all your subdomains. You can then use ZF's app-routing mechanism to handle those requests. In particular, you could configure various Zend_Controller_Router_Route_Hostname routes to handle the requests with your selected controllers/actions.

最后一点是哪些控制器和动作?为每个子域创建一个单独的模块听起来是个好主意.因此,上面的 Hostname 路由可以检测子域并使用适当的模块(和控制器/操作)处理请求.

The last bit is which controllers and actions? It sounds like a good idea to create a separate module for each subdomain. So the Hostname routes above can detect the subdomain and handle the request with the appropriate module (and controller/action).

这篇关于Zend 框架问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆