Template

Summary

No summary available.

Source

File: src/BigCommerce/Templates/Template.php

class Template {
	private $path;

	/**
	 * Template constructor.
	 *
	 * @param string $path Absolute filesystem path to the template
	 */
	public function __construct( $path ) {
		$this->path = $path;
	}

	/**
	 * Render the template to a string
	 *
	 * @param array $context Variables that will be passed to the template
	 *
	 * @return string
	 */
	public function render( array $context ) {
		extract( $context );
		ob_start();
		include $this->path;
		return ob_get_clean();
	}
}

Methods


User Contributed Notes

You must log in before being able to contribute a note or feedback.