All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline was successful
ci/woodpecker/push/functional-tests/3 Pipeline was successful
ci/woodpecker/push/functional-tests/2 Pipeline was successful
ci/woodpecker/push/functional-tests/4 Pipeline was successful
|
||
---|---|---|
.woodpecker | ||
Classes/ViewHelpers | ||
Configuration | ||
Resources/Private/Templates | ||
Tests/Functional | ||
composer.json | ||
License.txt | ||
README.md |
DigiComp.FluidJsonViews
This package builds upon DigiComp.FluidRenderFunctions
and uses this, to use a such defined render function to create a simple key/value json view from your QueryResult. Where the key will be the persistence identifier and the value the result of your rendered template.
Let me provide you an example:
<rf:registerRenderFunction as="renderTag">
{subject.name}
</rf:registerRenderFunction>
<fj:fluidJson objects="{tags}" renderFunction="renderTag" searchProperties="{0: 'name'}">
<a href="{dataUri}">jsonView</a>
</fj:fluidJson>
If you fetch the jsonView you will see something like this:
{
"recordsTotal": 2,
"recordsFiltered": 2,
"results": [
{"id": "a310057f-869e-419e-b6fe-6c3a00fe444a", "text": "hallo 2"},
{"id": "a310057f-869e-419e-b6fe-6c3a00fe444b", "text": "hallo"}
]
}
The provided link will understand three query parameters: limit
, term
and page
- all optional.
If you send a "term" parameter, it will apply an or sql search over all your given search property paths. limit
and page
will allow you to paginate the results.
For security and performance reasons, you can define a max limit using the provided values in Settings.yaml. There you can change the default limit (used, if not sent), or disable both (not recommended).