<commit_before>.. _zend.view.quick-start:

Zend\\View Quick Start
======================

.. _zend.view.quick-start.intro:

Overview
========

``Zend\View`` provides the "View" layer of Zend Framework 2's MVC system. It is a multi-tiered system allowing a
variety of mechanisms for extension, substitution, and more.

The components of the view layer are as follows:

- **Variables Containers** hold variables and callbacks that you wish to represent in the view. Often-times,
  a Variables Container will also provide mechanisms for context-specific escaping of variables and more.

- **View Models** hold Variables Containers, specify the template to use (if any), and optionally provide
  rendering options (more on that below). View Models may be nested in order to represent complex structures.

- **Renderers** take View Models and provide a representation of them to return. Zend Framework 2 ships with three
  renderers by default: a ``PhpRenderer`` which utilizes PHP templates in order to generate markup, a ``JsonRenderer``,
  and a ``FeedRenderer`` for generating RSS and Atom feeds.

- **Resolvers** utilizes Resolver Strategies to resolve a template name to a resource a Renderer may consume. 
  As an example, a Resolver may take the name "blog/entry" and resolve it to a PHP view script.

- The **View** consists of strategies that map the current Request to a Renderer, and strategies for
  injecting the result of rendering to the Response.

- **Rendering Strategies** listen to the "renderer" event of the View and decide which Renderer should be selected 
  based on the Request or other criteria.

- **Response Strategies** are used to inject the Response object with the results of rendering.
  That may also include taking actions such as setting Content-Type headers.

Additionally, Zend Framework 2 provides integration with the MVC via a number of event listeners in the
``Zend\Mvc\View`` namespace.
<commit_msg>EVENT_RENDER constant<commit_after>.. _zend.view.quick-start:

Zend\\View Quick Start
======================

.. _zend.view.quick-start.intro:

Overview
========

``Zend\View`` provides the "View" layer of Zend Framework 2's MVC system. It is a multi-tiered system allowing a
variety of mechanisms for extension, substitution, and more.

The components of the view layer are as follows:

- **Variables Containers** hold variables and callbacks that you wish to represent in the view. Often-times,
  a Variables Container will also provide mechanisms for context-specific escaping of variables and more.

- **View Models** hold Variables Containers, specify the template to use (if any), and optionally provide
  rendering options (more on that below). View Models may be nested in order to represent complex structures.

- **Renderers** take View Models and provide a representation of them to return. Zend Framework 2 ships with three
  renderers by default: a ``PhpRenderer`` which utilizes PHP templates in order to generate markup, a ``JsonRenderer``,
  and a ``FeedRenderer`` for generating RSS and Atom feeds.

- **Resolvers** utilizes Resolver Strategies to resolve a template name to a resource a Renderer may consume. 
  As an example, a Resolver may take the name "blog/entry" and resolve it to a PHP view script.

- The **View** consists of strategies that map the current Request to a Renderer, and strategies for
  injecting the result of rendering to the Response.

- **Rendering Strategies** listen to the ``Zend\Mvc\MvcEvent::EVENT_RENDER`` event of the View and decide which Renderer should be selected 
  based on the Request or other criteria.

- **Response Strategies** are used to inject the Response object with the results of rendering.
  That may also include taking actions such as setting Content-Type headers.

Additionally, Zend Framework 2 provides integration with the MVC via a number of event listeners in the
``Zend\Mvc\View`` namespace.

{'fraction_non_alphanumeric': 0.07776925044768483, 'fraction_numerical': 0.0015349194167306216, 'mean_word_length': 4.460893854748603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1883076', 'n_tokens_mistral': 1006, 'n_tokens_neox': 950, 'n_words': 545}