[development] Handling optional parameters
Nancy Wichmann
nan_wich at bellsouth.net
Wed Sep 24 14:49:56 UTC 2008
I have a module that may accept several optional parameters from the user.
The "standard" way of doing this is something like
"my-module/action/123/0/3/list/xyz" where everything after "123" is
optional, so doesn't show up in the menu entry.
I'm not crazy about this technique, although the menu system does make it
easy to use.
A) The user has to remember, or look up, the order of those parameters (I
have to look them up because I can't remember them, and I wrote it).
B) If the user is happy with an intermediate value (e.g. the "3" above),
they still have to specify it in order to use "list."
C) There is no flexibility.
I was playing around and realized that $_GET makes getting input parameters
from the query string pretty easy. It also gives me more flexibility in
adding (or removing) the optional parameters, means the user doesn't have to
remember the order, and means only values that are desired have to be
entered.
Will I be tarred and feathered for going the $_GET route?
Nancy E. Wichmann, PMP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080924/3d35bfb9/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 5675 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/development/attachments/20080924/3d35bfb9/attachment.jpeg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: multipart/alternative
Size: 0 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/development/attachments/20080924/3d35bfb9/attachment.bin
-------------- next part --------------
No virus found in this outgoing message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.7.0/1685 - Release Date: 9/22/2008 4:08 PM
More information about the development
mailing list