English 中文(简体)
Zend Framework Redirect and Lines, somehow not working
原标题:Zend Framework Redirect and Routes, somehow not working

我正试图把我的头部 around在路上,因此,我只想制造一个小的重复,以绕过,但我却设法陷入一个问题。

整个测试的目的是掩盖地标/联系/索引/内容,使接收人/用户/用户/用户/用户/用户/用户/用户/用户/接收者/接收者/接收者/接收者更容易理解。

但是,现在出于某种奇怪的原因,不能再使用“thi”法。 但是,有些联系像一些链接工作一样,是一种正常的联系。

我已在申请中修建了几条路线。 检查它如何运作。 ......

resources.router.routes.contentroute.route = "/wms/content"
resources.router.routes.contentroute.defaults.module = content
resources.router.routes.contentroute.defaults.controller = index
resources.router.routes.contentroute.defaults.action = index

resources.router.routes.vacaturesroute.route = "/wms/vacatures"
resources.router.routes.vacaturesroute.defaults.module = vacatures
resources.router.routes.vacaturesroute.defaults.controller = index
resources.router.routes.vacaturesroute.defaults.action = index

因此,当某类东道国名称/名称/联系人转而使用内容模块时,其索引主计长和索引行动。 这对我认为与内容模块类似的内容模块的所有链接来说都是值得称赞的。

<a href= wms/content/ > link </a>

但是,它没有为3个链接开展工作,这些链接实际上转向索引管理员在该网页的主机上采取的具体行动。

<a href="<?php echo $this->url(array( controller => index , action => add ));?>">Add new content</a>

避免实际上转向索引管理员的附加行动,即转而接收姓名/地址/联系人,则由i m comming出。

Anyone have an idea why this is happening and possibly a way to solve this? Or am i totally approaching this the wrong way?

最佳回答

首先,你的道路是固定的。 您应将其改为:

resources.router.routes.contentroute.route = "/wms/content/:action/*"
resources.router.routes.contentroute.defaults.module = content
resources.router.routes.contentroute.defaults.controller = index
resources.router.routes.contentroute.defaults.action = index

Then, you should specify the name of your route and pass true in reset argument:

$this->url(
  array( module => content ,  controller => index , action => add ), 
   contentroute , 
  true
);
问题回答

而是

<a href="<?php echo $this->url(array( controller => index , action => add , module => xyz ),null,true);?>">Add new content</a>

Replace xyz with your module name.





相关问题
Rails: Proxy Pass?

I ve got a web-app that I want to migrate to Rails, which is currently just plain HTML with an Apache proxy to another server, running a custom database/webserver that serves the site s dynamic ...

MVC routing is not handling one of my directories

I m using ASP.NET MVC with IIS 7.0. I ve got 404 errors hooked up fine through my Application_Error override. In addition to "Controllers", "Models", "Helpers" etc. I have a directory called Files ...

Ruby on Rails conditional routing

I have a site listing many jobs, but I also want each account to be able to access its jobs in one place. Thus, I am using these routes: map.resources :jobs map.resource :account, :has_many => :...

Clean URL s using OpenCart s router class

How do you write clean URL s in OpenCart using their built in Router class? Here is my .htaccess file: RewriteEngine On RewriteRule ^(system) - [F,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{...

subdomain routing to multiple controller issue

I have a site: www.mydomain.com where we have administrative controls hidden away from normal customer view. I would like to only access the administrative features under a subdomain such as admin....

Can controller names in RESTful routes be optional?

With a standard map.resource routing mechanics and several nested resources the resultant routes are unnecessarily long. Consider the following route: site.org/users/pavelshved/blogs/blogging-horror/...

Help with rails routes

Im having a little trouble setting up routes. I have a users controller/model/views set up restfully so users is set up to be a resource in my routes. I want to change that to be usuarios ...

热门标签