# hyperpay-gateways/5.3.0/src/App/View.php

HyperPay Payments, version 5.3.0. 35 lines.

- Page: https://pluginprobe.com/plugins/hyperpay-gateways/5.3.0/code/src/App/View.php
- Raw: https://pluginprobe.com/plugins/hyperpay-gateways/5.3.0/raw/src/App/View.php
- Modified: 2025-05-19T16:00:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/hyperpay-gateways/5.3.0/code/src/App/View.php#L10-L20`.

```php
<?php

namespace Hyperpay\Gateways\App;

if (! defined('ABSPATH')) exit;

use Hyperpay\Gateways\Main;

final class View
{
    public static function render($name, $params = [])
    {
        $loader = new \Twig\Loader\FilesystemLoader(Main::ROOT_PATH . "/assets/templates");
        $twig = new \Twig\Environment($loader);

        $params = static::esc($params);

        echo $twig->render($name, $params);
        return;
    }

    public static function esc($value)
    {
        if (is_array($value)) {
            $esc_values = [];
            foreach ($value as $key => $nested_value) {
                $esc_values[$key] =  static::esc($nested_value);
            }
            return $esc_values;
        }

        return esc_html($value);
    }
}

```
