Maslosoft Staple API
View Json Extractor
This extracts data from json file named same as view file, but with json extension. When resolving name, extension is not added to this json file.
For example, when there is file
index.php this will try to load data from
Some example files structure:
products/ index.php index.json spoon.md.php spoon.json fork.md fork.json
From example above data from json files will be attached by following associacions:
index.json --> index.php spoon.json --> sopon.md.php fork.json --> fork.md
Extracted data is available both in view and in layout.
- Maslosoft\Staple\Processors\Pre\ViewJsonExtractor implements Maslosoft\Staple\Interfaces\PreProcessorInterface
Author: Piotr Maselkowski
Located at Processors/Pre/ViewJsonExtractor.php