PHP code example of siteation / magento2-icons-payment

1. Go to this page and download the library: Download siteation/magento2-icons-payment 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/ */

    

siteation / magento2-icons-payment example snippets


 declare(strict_types=1);

use Hyva\Theme\Model\ViewModelRegistry;
use Magento\Framework\View\Element\Template;
use Magento\Framework\Escaper;
use Siteation\IconsPayment\ViewModel\PaymentIcons;

/** @var ViewModelRegistry $viewModels */
/** @var Template $block */
/** @var Escaper $escaper */

/** @var PaymentIcons $paymentIcons */
$paymentIcons = $viewModels->

 declare(strict_types=1);

use Magento\Framework\View\Element\Template;
use Magento\Framework\Escaper;
use Siteation\IconsPayment\ViewModel\PaymentIcons;

/** @var Template $block */
/** @var Escaper $escaper */

/** @var PaymentIcons $paymentIcons */
$paymentIcons = $block->getData('payment_icons');


// Render by name
$paymentIcons->renderHtml('ideal', 'p-1', 64, 48, ['title' => 'Pay with iDEAL']);

// Or through the per icon accessor, the same as the Heroicons in Hyva
$paymentIcons->idealHtml('p-1', 64, 48, ['title' => 'Pay with iDEAL']);