yireo-training/magento2-example-plugin-inject-variables-into-block

Example Magento 2 module showing how to use an interceptor to extend Block classes

dev-master 2020-08-19 12:50 UTC

This package is auto-updated.

Last update: 2024-04-19 21:15:29 UTC


README

Example Magento 2 module showing how to use an interceptor to extend Block classes

Installation

To install use the following composer command:

composer require yireo-training/magento2-example-plugin-inject-variables-into-block:dev-master

Next enable the module:

bin/magento module:enable Yireo_ExamplePluginInjectVariablesIntoBlocks
bin/magento setup:upgrade

And flush the cache:

bin/magento cache:clean

Proof of concept

The block with XML layout name absolute_footer should be replaced with a new PHTML template that also includes an $customer variable.