SignalTrait
The `suggest!` signal: returns JSON `{items: [{id, label, name, meta}]}` (same as `RegionSuggest`).
Table of Contents
Constants
- SUGGEST_CACHE_SECONDS : int = 3600
- The response depends only on `q`, language and module, not on the session, so the browser may cache it.
Methods
- handleSuggest() : void
- `picker.js` sends the query as a bare `q=...` (without the component prefix); Nette passes it to the presenter, so `q` is read from the presenter too (same as `RegionSuggest`).
Constants
SUGGEST_CACHE_SECONDS
The response depends only on `q`, language and module, not on the session, so the browser may cache it.
private
int
SUGGEST_CACHE_SECONDS
= 3600
private, not public: the front response carries the session Set-Cookie.
Methods
handleSuggest()
`picker.js` sends the query as a bare `q=...` (without the component prefix); Nette passes it to the presenter, so `q` is read from the presenter too (same as `RegionSuggest`).
public
handleSuggest([string $q = '' ]) : void
A GET without side effects, so CSRF is not handled. The Api enforces the rate limit
(CategorySuggestTrait, 60/min/IP); above it the response is HTTP 429 with empty items.
Parameters
- $q : string = ''