Currently in the config file you can do this:

'resources'   => array(
        'frontController' => array(
            'moduleDirectory' => APPLICATION_PATH . '/modules'
        ),
        'router' => array(
            'routes' => include dirname(__FILE__) . '/routes.config.php'
        ),
        'view' => array(
            'helperPath' => array(
                'App_View_Helper_' => APPLICATION_PATH .
'/library/App/View/Helper'
            )
        ),
    )

as you can see both moduleDirectory and helperPath accepts a directory which
is scanned and all files are included. Can the routes have the same option?
To add several files inside a directory and each file will return something
like this (which is what used currently under routes.config.php)

<?php
return array(
    'default' => array(
        'type'  => 'Zend_Controller_Router_Route_Static',
        'route' => '',
        'defaults' => array(
            'module'     => 'default',
            'controller' => 'error',
            'action'     => 'notfound'
        )
    ),
    'complete_recover' => array(
        'type'  => 'Zend_Controller_Router_Route',
        'route' => 'recover-password/:user_id/:recover_code',
        'defaults' => array(
            'module'     => 'default',
            'controller' => 'users',
            'action'     => 'completerecover'
        )
    ),
    'files_browse' => array(
        'type'  => 'Zend_Controller_Router_Route_Regex',
        'route' => 'files(\/.*)',
        'defaults' => array(
            'module'     => 'default',
            'controller' => 'files',
            'action'     => 'index'
        ),
        'map' => array(
            'path' => 1
        ),
        'reverse' => 'files%s'
    ),
);

and by that allowing us to just drop more files inside a directory without
the need of editing existing files and routes.

Thanks.

-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/

Reply via email to