Hello,

As a little project I want to write a Javascript/CSS compressor for use with the zend framework. I intend to build it as a module, so it can be easily used in different projects as well. Thing is, I'm having a spot of trouble with the routing process. I have modified my .htaccess to send requests ending in .js and .css to my index.php bootstrap. All the javascript files are in the same subdirectory of the webroot (js/), so I should be able to filter the request on that.

I tried adding a route like so:

$router->addRoute(

'javascript',
//name of the route

new Zend_Controller_Router_Route('js/:file',
//all javascript is served from the js directory

array(
'module' => 'jscsscompressor',
'controller' => 'index',
'action' => 'compress')
)
//jscsscompressor/index/__call

);

which works fine, as long as the javascript file I'm trying to request isn't in a subdirectory of the js directory. If that is the case, I get:

Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (js)'

Am I doing this the right way? If I remove the :file bit I get the same error even without subdirectories.

--
Maurice Fonk

[EMAIL PROTECTED]
http://naneau.nl/

Scio me nihil scire

Reply via email to