feed: a worked URL-parameter example for the hook read, and the generated cover
This commit is contained in:
@@ -64,16 +64,26 @@ Those are the services that run customer code. The viewer's `viewlibs`, `viewtab
|
||||
|
||||
## Reading them in a hook
|
||||
|
||||
A hook script is `%include`d into the running service, so it shares the service's WORK library and can read the tables directly. A URL parameter by name:
|
||||
A hook script is `%include`d into the running service, so it shares the service's WORK library and can read the tables directly. Take an embedded editor opened at:
|
||||
|
||||
```
|
||||
https://datacontroller.io/#/editor/SASHELP.CLASS?labels=true&embed=va
|
||||
```
|
||||
|
||||
`browser_url_vars` then holds a row per parameter - `labels=true` and `embed=va` - and a hook can read either by name:
|
||||
|
||||
```sas
|
||||
%let labels=N;
|
||||
%let embed=N;
|
||||
|
||||
%if %sysfunc(exist(work.browser_url_vars)) %then %do;
|
||||
proc sql noprint;
|
||||
select value into :labels
|
||||
from work.browser_url_vars
|
||||
where name = 'labels';
|
||||
select value into :embed
|
||||
from work.browser_url_vars
|
||||
where name = 'embed';
|
||||
quit;
|
||||
%end;
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user