PHPackages                             jyoungblood/stereo-render - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. jyoungblood/stereo-render

ActiveLibrary[Templating &amp; Views](/categories/templating)

jyoungblood/stereo-render
=========================

PHP abstraction functions to help more easily render views for Slim Framework. Includes support for JSON, HTML, and Blade.

1.0.1(1y ago)09[3 issues](https://github.com/jyoungblood/stereo-render/issues)1MITPHP

Since Sep 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jyoungblood/stereo-render)[ Packagist](https://packagist.org/packages/jyoungblood/stereo-render)[ Docs](https://github.com/jyoungblood/stereo-render)[ RSS](/packages/jyoungblood-stereo-render/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (1)

STEREO Render
=============

[](#stereo-render)

### PHP abstraction functions to help more easily render views for [Slim Framework](https://www.slimframework.com/) (v4) with plain text, HTML, JSON, and Blade (using [BladeOne](https://github.com/EFTEC/BladeOne))

[](#php-abstraction-functions-to-help-more-easily-render-views-for-slim-framework-v4-with-plain-text-html-json-and-blade-using-bladeone)

These functions aim to provide a simplified and standardized interface for rendering various types of data-driven responses as PSR-7 objects for use with Slim.

Although this package can be used with any Slim4 project, it's specifically designed for use with the [STEREO](https://github.com/jyoungblood/stereo) internet toolkit.

Installation
============

[](#installation)

Easy install with composer:

```
composer require jyoungblood/stereo-render

```

```
use Stereo\render;
require __DIR__ . '/vendor/autoload.php';
```

Requirements
------------

[](#requirements)

- [Slim Framework](https://www.slimframework.com/) 4
- [BladeOne](https://github.com/EFTEC/BladeOne) &gt;= 4.13
- PHP &gt;= 7.4

Usage
=====

[](#usage)

render::html($request, $response, $string, $status = 200)
---------------------------------------------------------

[](#renderhtmlrequest-response-string-status--200)

Renders a string as HTML. Returns a standard Slim (PSR-7) response object with optional HTTP status code (200 by default).

```
$app->get('/', function ($req, $res, $args) {

  return render::html($req, $res, 'Hey whats up');

});
```

Additionally, a path to an HTML file (relative to the `public` web root) can be specified to load and render instead of a string:

```
$app->get('/', function ($req, $res, $args) {

  return render::html($req, $res, 'hey/whats-up.html');

});
```

render::text($request, $response, $string, $status = 200)
---------------------------------------------------------

[](#rendertextrequest-response-string-status--200)

Renders a string as plain text. Returns a standard Slim (PSR-7) response object with optional HTTP status code (200 by default).

```
$app->get('/', function ($req, $res, $args) {

  return render::text($req, $res, 'Hey whats up');

});
```

render::redirect($request, $response, $string, $status = 302)
-------------------------------------------------------------

[](#renderredirectrequest-response-string-status--302)

Renders a redirect as standard Slim (PSR-7) response object with optional HTTP status code.

```
  return render::redirect($req, $res, 'https://google.com/');
```

render::json($request, $response, $data, $status = 200)
-------------------------------------------------------

[](#renderjsonrequest-response-data-status--200)

Renders an array or data as standard Slim (PSR-7) response object with `application/json` content type and optional HTTP status code.

```
$app->get('/json/', function ($req, $res, $args) {

  $data = [
    'name' => 'Ringo',
    'friends' => [
      'Paul', 'George', 'John'
    ]
  ];

  return render::json($req, $res, $data);

});
```

render::blade($request, $response, $parameters, $status = 200)
--------------------------------------------------------------

[](#renderbladerequest-response-parameters-status--200)

Renders a specific Blade template with an array of data. Returns a standard Slim (PSR-7) response object with optional HTTP status code (200 by default).

```
$app->get('/', function ($req, $res, $args) {

  return render::blade($req, $res, [
    'template' => 'index',
    'data' => [
      'name' => 'Ringo',
      'friends' => [
        'Paul', 'George', 'John'
      ]
    ],
  ], 200); // optional status code, 200 by default

});
```

The Blade compiler expects views and cache files to be directories called `views` and `cache`, respectively, in the `public` web root. These defaults, along with the compilation mode, can be customized in your `.env` file:

```
BLADE_VIEWS_PATH = "views"
BLADE_CACHE_PATH = "cache"
BLADE_MODE = "AUTO"
```

The compilation mode can be set to `AUTO` (default), `SLOW`, `FAST`, or `DEBUG`, see the [BladeOne](https://github.com/EFTEC/BladeOne/blob/master/lib/BladeOne.php#L44) source for more information.

Check out the [BladeOne](https://github.com/EFTEC/BladeOne) and official [Blade](https://laravel.com/docs/blade) documentation to see everything you can do with this incredible templating syntax.

The [BladeOne HTML Extension](https://github.com/EFTEC/BladeOneHtml) is also included for conveniently creating form components with near-native performance.

render::blade\_template($parameters)
------------------------------------

[](#renderblade_templateparameters)

Renders a specicific Blade template with data array the same as `render::blade()`, but returns raw html instead of a PSR-7 response.

```
$app->get('/', function ($req, $res, $args) {

  echo render::blade_template('email/test', [
    'link' => 'https://jy.hxgf.io',
  ]);

  return $res;
});
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

2

Last Release

593d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4130bfc70d308f890899a0c223f9888271f0fd3f91879b09558ba696862d8d4?d=identicon)[jyoungblood](/maintainers/jyoungblood)

---

Top Contributors

[![jyoungblood](https://avatars.githubusercontent.com/u/56104?v=4)](https://github.com/jyoungblood "jyoungblood (4 commits)")

---

Tags

slimbladeutilitiesview helpersrender abstractions

### Embed Badge

![Health badge](/badges/jyoungblood-stereo-render/health.svg)

```
[![Health](https://phpackages.com/badges/jyoungblood-stereo-render/health.svg)](https://phpackages.com/packages/jyoungblood-stereo-render)
```

###  Alternatives

[blade-ui-kit/blade-icons

A package to easily make use of icons in your Laravel Blade views.

2.5k34.2M309](/packages/blade-ui-kit-blade-icons)[blade-ui-kit/blade-heroicons

A package to easily make use of Heroicons in your Laravel Blade views.

64127.9M111](/packages/blade-ui-kit-blade-heroicons)[eftec/bladeone

The standalone version Blade Template Engine from Laravel in a single php file

8208.4M87](/packages/eftec-bladeone)[eftec/bladeonehtml

The standalone version Blade Template Engine from Laravel in a single php file

1018.1k5](/packages/eftec-bladeonehtml)[yocmen/html-minify

Minifies the HTML output of Laravel 5 applications (Originally from https://github.com/fitztrev/laravel-html-minify)

1713.7k](/packages/yocmen-html-minify)[allantatter/laravel-react

Render React.js components seemlessly on the server side within Laravel Blade views.

511.5k](/packages/allantatter-laravel-react)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
