1. Go to this page and download the library: Download magehx/mage-template-utils library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
magehx / mage-template-utils example snippets
<?= $esc->html(__('Hello world!'))
<?= $escaper->escapeHtml(__('Hello world!'))
use Namespace\Module\ViewModel\YourViewModel;
use MageHx\MageTemplateUtils\Model\ViewModelProvider;
/** @var ViewModelProvider $viewModelProvider */
$viewModel = $viewModelProvider->get(YourViewModel::class);