|
From: <an...@io...> - 2005-07-02 21:49:26
|
Antti M Vähäkotamäki wrote:
> By the way, assigning url_additional automatically according to
> configuration is a brilliant idea in many ways :) I just started to
> think of it more and concluded that if the task could be determined
> before execute then we could assign url_additional before execute, we
> possibly wouldn't need the additional url parameters in action anymore,
> thus separating us from the request.. nice :)
Thought about this some more. I think it is a good idea to reserve an
accessor (or a parameter) in the action for the array of all additional
parts since it defines the action much like action's name or it's
task. You never know when it is needed ;)
Also it would be nice to add the rest of the additional parts, which
were not mapped to a param, to a separate param.
So if your url would be:
/filearea/download/users/madonna/music/garbage.mp3
and your action.ini would have:
[filearea url_additional]
download = area_type
download = area_id
The you would end with an action such that:
$action->additional -> [ 'users', 'madonna', 'music', 'garbage.mp3' ]
$action->param('area_type') -> 'users'
$action->param('area_id') -> 'madonna'
$action->param('other_additional') -> [ 'music', 'garbage.mp3' ]
What do you think?
Also in Dicole we have a $action->derive_url -function which tries to
take the current action's url and modify it a bit:
$action->derive_url( task => 'view') =>
/filearea/view/users/madonna/music/garbage.mp3
You might want concider something similiar for OI2 - it has been quite
handy for our use since we also usually have an additional id in the url
specifying target user or group and it hardly ever changes. We haven't
yet modified it to use url_additional settings so that it would be
possible to override also those in a similiar fashion, but I think it
will be done at some point like this:
$action->derive_url( area_id => 'bjork', other_additional => [
'robots.txt'] ) -> /filearea/download/users/bjork/robots.txt
- Antti
|