From: ogden n. <on...@wa...> - 2005-06-27 20:20:58
|
Hi, I have an interesting question and hopefully someone has experience or insight with this. For our site (a Myspace.com type site for fun), the URLs are currently: http://www.url.com/members/email/email_msg.csc?to_member=39 (For emailing a member on the site). However, I would prefer if the URL would be: http://www.url.com/members/email/email_msg/39 or http://www.url.com/members/view_picture_comments/41 (where 41 is the picture ID from the database). So I can do a dhandler in the top level of /members/: <%init> my $member = (split /\//, $r->uri)[-1]; my $action = (split/\//, $r->uri)[-2]; if ($action eq "email_msg"){ $m->comp("../email/email_to_member.csc", to_member => $member); }elsif ($action eq "view_picture_comments"){ $m->comp("../pictures/view_comments.csc", pictureID => $member); } ........... </%init> Is this an ugly way to do things? I also would have to pass each argument that the components need from the dhandler to the component (like $subject, $body, etc). This will make the %args list insanely big, as it will have to gather ALL arguments ever needed for the site. Is it even worth doing - maybe I'm being too anal... Thank you Ogden |