2010-12-07 22 views
0

我在backend/modules/ordini/actions/actions.class.php中創建了一個名爲executeDetagli()的新動作。嘗試在後端模塊中創建新操作:「操作」模塊/ show「不存在」。

當我嘗試去 「backend_dev.php/ordini/detagli」 這給了我這個錯誤:

404 | Not Found | sfError404Exception Action "ordini/show" does not exist. stack trace

* at() 
    in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/sfController.class.php 

line 192 ... 189. $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Action "%s/%s" does not exist', $moduleName, $actionName)))); 190. } 191.

  192.  throw new sfError404Exception(sprintf('Action 

"%s/%s" does not exist.', $moduleName, $actionName)); 193. } 194.

  195.  // create an instance of the action 
* at sfController->forward('ordini', 

'show') in SF_ROOT_DIR/lib/vendor/symfony/lib/controller/sfFrontWebController.class.php line 48 ... 45. } 46.

  47.  // make the first request 
      48.  $this->forward($moduleName, 

$actionName); 49. } 50. catch (sfException $e) 51. { * at sfFrontWebController->dispatch() in SF_ROOT_DIR/lib/vendor/symfony/lib/util/sfContext.class.php line 170 ... 167. */ 168. public function dispatch() 169. { 170. $this->getController()->dispatch(); 171. } 172.

  173. /** 
* at sfContext->dispatch() 
    in SF_ROOT_DIR/web/backend_dev.php line 

13 ... 10. require_once(dirname(FILE).'/../config/ProjectConfiguration.class.php'); 11.

  12. $configuration = ProjectConfiguration::getApplicationConfiguration('backend', 

'dev', true); 13. sfContext::createInstance($configuration)->dispatch(); 14.

我在routing.yml中有這樣的:

shop_order: 
    class: sfPropelRouteCollection 
    options: 
    model:    ShopOrder 
    module:    ordini 
    prefix_path:   /ordini 
    column:    orders_id 
    with_wildcard_routes: true 


default: 
    url: /:module/:action/* 

任何想法?

SF 1.4 /推進

哈維

回答

0

嘗試:

  • symfony cc
  • 確保該視圖... /模塊/ ordini /模板/ detagliSuccess.php存在

回答您的評論:在你的routing.yml中,嘗試添加路由規則類似以下,只是前的最後規則,匹配但沒有尾隨斜線module/action模式(因爲我猜測,ordini/detagli行動韓元「T匹配的第一條規則):

default_noslash: 
    url: /:module/:action 

同時,也有很多的解決方案,你可以用幾個谷歌搜索得到:

http://blog.phpleo.com/2008/01/27/redireccion-301-en-symfony-filtros-vs-htaccess/

http://www.decentmind.com/2010/07/symfony-without-a-slash-at-the-tail/

希望它有幫助。

+0

我這樣做,但它不起作用。 – ziiweb 2010-12-07 19:51:55