ZF2 controller returned JsonModel

Return a

\Zend\View\Model\JsonModel

in controller action.

Tell the view manager to use JsonStrategy:

    'view_manager' => array(
        'template_map' => array(
        ),
        'template_path_stack' => array(
            'MyModule' => __DIR__ . '/../view',
        ),
        'strategies' => array(
            'ViewJsonStrategy', // to call controller action (returned JsonModel) without view file
        ),
    ),

…otherwise it searches for a view file.