2010-02-22 201 views
0

我有與位於一個文件夾,名爲../application/default/views/scripts/statiskt/student/(index.html一些靜態頁面的網站)(從webroot中看到的)。Zend框架HTTP路由器

我可以通過mydomain.se/statiskt/student/(index.html訪問這些「靜態」頁)。

的問題是,我希望能夠通過mydomain.se/student/(index.html訪問它們)。

我在Zend路由器上使用了Zend Framework。

我幾乎熟悉Zend框架,所以我要問你 - 這可能嗎?我如何實現它?

從怪異的拼寫檢查,對不起任何錯別字的iPhone發送。

回答

1

您是否嘗試過修改任何的例子從ZF Manual on Routes

$route = new Zend_Controller_Router_Route_Static(
     'student', 
     array('controller' => 'statiskt', 
      'action' => 'student') 
); 
    $router->addRoute('staticStudent', $route); 

如果沒有控制器和靜態頁面的動作,例如,它們不會與ZF的MVC組件一起使用,然後在您的/pub文件夾中重寫.htaccess的URL以指向適當的路徑。請參閱http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

+0

謝謝,解決了它! – joar 2010-02-22 13:37:01