PHPackages                             fizzka/phalcon-json-view - 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. fizzka/phalcon-json-view

ActiveLibrary

fizzka/phalcon-json-view
========================

Return phalcon controller response as JSON

12111PHP

Since Oct 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/fizzka/phalcon-json-view)[ Packagist](https://packagist.org/packages/fizzka/phalcon-json-view)[ RSS](/packages/fizzka-phalcon-json-view/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

phalcon-json-view
=================

[](#phalcon-json-view)

Little stuff to make json responses in phalcon

Installation
------------

[](#installation)

clone repo or `composer require fizzka/phalcon-json-view`

Usage
-----

[](#usage)

### Step 1

[](#step-1)

Customize your phalcon events manager:

```
use Fizz\Phalcon\JsonView\JsonView;
use Phalcon\Mvc\Dispatcher;

$di->set('dispatcher', function () use ($di) {
    $eventsManager = $di->getShared('eventsManager');

    $json = new JsonView();

    $eventsManager->attach('dispatch:afterDispatchLoop', $json);

    $dispatcher = new Dispatcher();

    $dispatcher->setEventsManager($eventsManager);
    return $dispatcher;
}, true);
```

### Step 2

[](#step-2)

Disable view:

```
use Phalcon\Mvc\View;

$di->set('view', function () {
    $view = new View();
    $view->disable();
    return $view;
}, true);
```

### Step 3

[](#step-3)

Extend abstract class Fizz\\Phalcon\\JsonView\\Controller;

```
use Fizz\Phalcon\JsonView\Controller;

class ExampleController extends Controller
{
	public function indexAction()
	{
		return ['foo' => 'baz'];
	}
}
```

Code example
------------

[](#code-example)

Full-working example @see [example.php](example.php)

License
-------

[](#license)

MIT

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ff5d99372207454da4404d4c619ff55ab4d6b9cf9674d8a122507961b3a651f?d=identicon)[fizzka](/maintainers/fizzka)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/fizzka-phalcon-json-view/health.svg)

```
[![Health](https://phpackages.com/badges/fizzka-phalcon-json-view/health.svg)](https://phpackages.com/packages/fizzka-phalcon-json-view)
```

PHPackages © 2026

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