views:

36

answers:

2

Hi, I've got a problem with Zend Framework, when calling an action.

This action is called "uploadvideo" inside a controller called "UploadInterfaceController". Therefor the view is called "uploadvideo.phtml".

Now all this is wrapped in a module called "Upload".

The problem is, that I cannot call a link inside the uploadvideo.phtml. I tried following code:

<a href="<?php echo $this->url(array('action'=>'uploadvideo','controller'=>'Uploadinterface','module'=>'upload',)); ?> "

and it produces me a nice clean URL (webroot/public/upload/UploadInterface/videoupload).

.

But

A dispatcher-error occurs, which I can't explain:

Zend_Controller_Dispatcher_Exception: Invalid controller class ("Upload_UploadinterfaceControll") [...]

I don't get it, where ZF is getting the "Upload_" prefix. I tried renaming the Controllers (and the representing entries in .zfproject.xml) but it stayes the same.

Can you help me please? Thx, Frank

+3  A: 

If you are using modules, your controllers need to have the module name as a prefix (except for the default module).

So your upload module controllers class names need to start with "Upload_".

David Radcliffe
Works fine! Thank you David.
Frankie-T
+1  A: 

The error states "Invalid Controller Class" are you sure you are extending Zend_Controller_Action?

Chris
Yeah, I created the controller via zend tool.Something that bothers me is, that zend tool isn't considering the module-name. It could easily put the MODULENAME_ prefix onto the classname.
Frankie-T
Actually it does create the prefix.. must have deleted it earlier
Frankie-T