How can I access HTTP request parameters from DW Anything?

Дата добавления:
17.01.2012
Хиты:
269
Рейтинг:
 
Голосовать:
Хорошо - Плохо

Ответ

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

Категория

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


Защитный код
Обновить

SEO by Artio