SignalTrait
The `suggest!` signal: JSON `{items: [{id, label, name, meta, type, data}]}`.
Table of Contents
Constants
- SUGGEST_CACHE_SECONDS : int = 3600
- The response depends only on `q`, the language and the field configuration, not on the session, so the browser HTTP cache applies. `private`, not `public`: the front end response carries the session `Set-Cookie` and a shared cache (CDN/proxy) would hand it to other visitors.
Methods
- handleSuggest() : void
- `picker.js` sends the query as a bare `q=…` (no component prefix); Nette gives it to the presenter, not to the signal argument, so `q` is read from the presenter too (as the admin Picker does).
Constants
SUGGEST_CACHE_SECONDS
The response depends only on `q`, the language and the field configuration, not on the session, so the browser HTTP cache applies. `private`, not `public`: the front end response carries the session `Set-Cookie` and a shared cache (CDN/proxy) would hand it to other visitors.
private
int
SUGGEST_CACHE_SECONDS
= 3600
Methods
handleSuggest()
`picker.js` sends the query as a bare `q=…` (no component prefix); Nette gives it to the presenter, not to the signal argument, so `q` is read from the presenter too (as the admin Picker does).
public
handleSuggest([string $q = '' ]) : void
A GET without side effects, so CSRF is not handled. The Api holds the rate limit
(RegionPresenter::internalActionSuggest(), 60/min/IP); over the limit: HTTP 429 and empty items.
Parameters
- $q : string = ''