I think the best is to provide a an action with the widget as an extension, to be reused in every controller using the extension, an action class extends CAction can be configured can has it's own behavior etc, read the wiki and the api
Yii widget: where to place an action? I need to access server from js
-
12-01-2022 - |
Question
I am going to write a widget such as user could select country and city. The widget will use geo db from vk.com, but I want to request vk.com from the server-side, internally. Currently I am doing so by actionSuggestCities().
browser <-- widget: js routine <-- site: actionSuggestCities() <-- vk.com: api
How could I make a well-formed widget, such that someone could install it and do not add actionAutocomplete() in his controllers?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow