# better-payment/1.0.0/includes/Traits/Helper.php

Better Payment – Instant Payments, Donations, Fundraising with Subscriptions &amp; More, version 1.0.0. 43 lines.

- Page: https://pluginprobe.com/plugins/better-payment/1.0.0/code/includes/Traits/Helper.php
- Raw: https://pluginprobe.com/plugins/better-payment/1.0.0/raw/includes/Traits/Helper.php
- Modified: 2022-04-18T10:23:46+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/better-payment/1.0.0/code/includes/Traits/Helper.php#L10-L20`.

```php
<?php

namespace Better_Payment\Lite\Traits;

/**
 * Exit if accessed directly
 */
if (!defined('ABSPATH')) {
    exit;
}

/**
 * Helper trait
 * 
 * @since 0.0.1
 */
trait Helper
{
    use Elements, ElementorHelper, WordPressHelper;

    public function bp_template_render($filePath, $variables = array(), $print = true)
    {
        $output = NULL;
        if (file_exists($filePath)) {
            // Extract the variables to a local namespace
            extract($variables);

            // Start output buffering
            ob_start();

            // Include the template file
            include $filePath;

            // End buffering and return its contents
            $output = ob_get_clean();
        }
        if ($print) {
            print $output;
        }
        return $output;
    }
}

```
