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



Добавить комментарий