2012-08-15 64 views
1

這是我的表單生成器功能:Zend框架:動作不存在

private function getAddArtistForm() { 
    $form = new Zend_Form(); 
    $form->setAction("saveArtist"); 
    $form->setMethod("post"); 
    $form->setName("addartist"); 
    ... 
} 
public function newAction() 
{ 
    $form = $this->getAddArtistForm(); 
    $this->view->form = $form; 

} 

我也有一個動作命名爲saveArtistAction

public function saveArtistAction() { 
... 
} 

但是,當我提出我得到以下錯誤形式:

Message: Action "saveartist" does not exist and was not trapped in __call() 

請求參數:

array (
    'controller' => 'artist', 
    'action' => 'saveartist', 
    'module' => 'default', 
) 

回答

5

如果指定action連字符是什麼:

'action' => 'save-artist', 

+0

....然後工作! – user16948 2012-08-16 00:09:45