background preloader

FrameWork Basic

Facebook Twitter

Zend Framework. Programmer’s Reference Guide of Zend Framework 2 — Zend Framework 2 2.0.5 documentation. Edit this document The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed. Login with your GitHub account. Returning JSON from a ZF2 controller action.

The new view layer in Zend Framework 2 can be set up to return JSON rather than rendered HTML relatively easily.

Returning JSON from a ZF2 controller action

There are two steps to this: Set up the JsonStrategy. Composer. Composer is a tool for dependency management in PHP.

Composer

It allows you to declare the dependent libraries your project needs and it will install them in your project for you. Dependency management# Composer is not a package manager. Yes, it deals with "packages" or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default it will never install anything globally.