user16948
user16948

Reputation: 4951

Zend Framework: Action does not exist

This is my form generator function:

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;

}

I have also an action named saveArtistAction:

public function saveArtistAction() {
...
}

But when I submit the form I get the following error:

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

Request Parameters:

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

Upvotes: 2

Views: 3360

Answers (1)

zerkms
zerkms

Reputation: 254926

What if you specify action with hyphen:

'action' => 'save-artist',

?

Upvotes: 7

Related Questions