How can I access HTTP request parameters from DW Anything?
Ответ
As of version 2.0, you can use the special set of DW Anyting tags to access parameters passed via HTTP request, e.g. in URL string or form data.
Example
Item | Value | Description |
---|---|---|
URL string |
http://yourdomain.com/index.php?option=com_yourcomponent&id_group=18 |
You pass the group ID number to your component using URL string (HTTP GET request) |
DW Anyting Parameters | ||
SQL Query | SELECT `id`, `name` FROM `#__users` WHERE `gid` = '{request.id_group}' |
To get the value of your request parameter, you can place the {request.parameter_name} within any part of your DW Anythgin template, including header and footer, as well as the SQL query |
Header HTML | <ul> |
|
Template | <li>User #{id}: {name}</li> |
|
Footer HTML | </ul> |
Result
- User #63: John
- User #64: Mary
Комментарии
What url do I use to access it and pass a parameter to it?
I have tried
http://www.victorianracing.com/index.php?option=com_showHorse&horse_ID=2
but it doesn't work. Any ideas would be most welcome
how is your showHorse module related to DW Anything?
Instead, publish your module on one or more of your site's pages. To pass parameter to DW Anything, append it to the URL of the page having your module on it. E. g., http://www.victorianracing.com/index.php?option=com_content&view=article&id=1&horse_ID=2
RSS лента комментариев этой записи