Comments (1)
I'm not sure I understand the question but to return JSON:
$payload = json_encode(['your' => 'payload']);
$response->getBody()->write($payload);
return $response->withHeader('Content-Type', 'application/json');
from php-view.
Related Issues (20)
- Layout functionality HOT 1
- Rendering sub-templates? HOT 3
- Enable Travis support HOT 1
- the reserved $template key in data array HOT 4
- Error trying to load javascript scripts by it src attribute HOT 5
- Layout support HOT 2
- Handling 404 errors
- PhpRenderer::render() manipulates input response HOT 1
- Loop HOT 1
- Sub-templates and layouts HOT 6
- Slim 4
- Can I access the slim properties from the templates? HOT 2
- $_SESSION global variable is not available when rendering $content HOT 2
- PHP 8
- How can I include CSS in templates when using a layout HOT 4
- Switch CI from Travis to Github Actions
- Unable to flush/reset reset body when calling multiple render() HOT 2
- New Release? HOT 2
- it support javascrit ejecutions? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-view.