[Solar-talk] RewriteRouter port

Rodrigo Moraes rodrigo.moraes at gmail.com
Wed Oct 4 07:26:23 PDT 2006


On 10/4/06, Paul M Jones wrote:
> Sure thing; you have code available somwhere?

Paul, I've just commited it. Checkout the controller directory:

http://tipos.org/svn_tipos/Tipos/Controller/

Only the basic steps are done and no Solar_App work with it. It works
mainly like ZF: you set a controllers directory for the
FrontController to point to where the controllers are placed:

$config['Tipos_Controller_Front'] = array(
    'dir'        => '/var/www/solar_released/controllers',
);

And then you run it, after you define some controllers
('appNameController', 'appNameTwoController'):

$front = Solar::factory('Tipos_Controller_Front');
$routes = array();

$routes['appName'] = array(
    'route'     => 'myApp/:action',
    'defaults' => array('controller' => 'appName', 'action' => 'main')
    );

$routes['appNameTwo'] = array(
    'route'     => 'anotherApp/:action',
    'defaults' => array('controller' => 'appNameTwo', 'action' => 'main')
    );

$front->addRoutes($routes);
$front->run();

Of course, much work is still needed. But I hope I'll get the
Bookmarks app working using it this week.

rodrigo


More information about the solar-talk mailing list