Lesson1: Introduction block layout and template in magento

0
52
Introduction block layout template

What’s in this topic

This article describes the basic concepts you need to know about block, layout xml and template in magento 2.

1. What is layout XML?

● Defines the content on a given page
○ via 2 element types: containers and blocks
● Determine the page structure / hierarchy
○ Also known as the ‘element tree’

2. What is a Block class?

● A PHP class that collates and transforms data for presentation (output) on the frontend
○ In most cases in a template file

3. What are template files for?

● Outputting HTML markup and data passed from:
○ Block classes
○ Layout XML