Hi again,

Seems like I'm thinking pretty much about Agavi's API and how it can
be enhanced. My suggestion this time is to introduce some API for
custom URL generation based on a format string. For example, if i want
to rewrite my URLs to be on the format  I'd pass a format to the
controller like

$controller->setUrlFormat('%m%/%a%');

where  %m% and %a% would be replaced by module name and action name respectively
so when i generated URL I'd call

$controller->generateUrl($module, $action, $params);
// this show generate AG_WEB_HOME.'/module/action?param=value'
// where AG_WEB_HOME should be defined as the URL for index.php base dir

A convenience function to do the same can be introduced in the
template as well (?)... some  mod_rewrite directives has to be written
to rewite URL back to ?module=X&action=Y ... a template .htaccess can
be used to  generate a format-specfic .htaccess  by means of a phing
task (as a part of "agavi project" task?).

what do you think?

-ahmed
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev

Reply via email to