Close [x]

Overview

An independent view layer domain, the View component was created to eliminate global dependencies on聽Magento_Core,聽Magento_Backend,聽Magento_Adminhtml聽and聽Magento_Page聽modules for HTML content rendering. All application modules perform rendering using the View component, and remain independent from each other.

The View component is represented as聽Magento\Framework\View聽library:聽/lib/internal/Magento/Framework/View.

Using聽Magento\Framework\View聽Library

The View component contains basic classes, factories and interfaces used to implement HTML content rendering 聽for the frontend and backend application areas.聽

Magento\View Library聽Components

The聽Magento\Framework\View聽library has the following components:

  • Template Engine

  • Page Assets

  • Element (Block)

  • Design

    • File Resolution

    • Fallback

    • Theme

  • Layout.

Magento\Framework\View聽Library聽Dependencies

The聽Magento\Framework\View聽library closely interacts with other Magento libraries and modules, so it has multiple dependencies.聽

Magento\Framework\View聽depends on the following Magento libraries: 聽

  • \Magento\Framework\App\Dir

  • \Magento\Framework\Autoload

  • \Magento\Framework\Code

  • \Magento\Framework\Config

  • \Magento\Framework\Data

  • \Magento\Framework\Event

  • \Magento\Framework\File

  • \Magento\Framework\Filesystem

  • \Magento\Framework\Filter

  • \Magento\Framework\HTTP

  • \Magento\Framework\Image

  • \Magento\Framework\Json

  • \Magento\Framework\Message

  • \Magento\Framework\Module

  • \Magento\Framework\Object

  • \Magento\Framework\ObjectManager

  • \Magento\Framework\Profiler

Magento\Framework\View聽depends on the following modules:

  • Magento_Core

Apart from obvious and reasonable dependencies, the聽Magento\Framework\View聽library has so-called artifact dependencies, which will be refactored in future releases.

Basic Magento modules that interact with the聽Magento\Framework\View聽library are:

  • Magento_Core

  • Magento_Theme

  • Magento_Backend

  • Magento_FullPageCache

  • Magento_Widget

In addition, a few other modules also use the聽Magento\Framework\View聽library in method calls, constructors of models, and helper classes.

The majority of Magento module聽dependencies on the聽Magento\Framework\View聽library are induced on the level of Magento block classes聽implementation. These dependencies result from the unified process of block classes creation, which is implemented by means of the聽Magento\Framework\View聽library: two parent classes (\Magento\Framework\View\Element\AbstractBlock聽and\Magento\Framework\View\Element\Template) are common ancestors for all block classes of Magento modules, and implement the聽\Magento\Framework\View\Element\BlockInterface聽interface.