How can I access HTTP request parameters from DW Anything?

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

Ответ

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

Категория

Комментарии   

 
0 # How to access dwanyting moduleGlenn 27.11.2012 06:07
I have created a module called "showHorse"

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 :-)
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: How to access dwanyting moduleAdministrator 27.11.2012 14:59
Hi Glenn,

how is your showHorse module related to DW Anything?
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: How to access dwanyting moduleAdministrator 28.11.2012 15:02
You cannot access any module from URL - that's what components are for, not modules.

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
Ответить | Ответить с цитатой | Цитировать
 

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


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

SEO by Artio