# templately/3.4.2/includes/Utils/Views.php

Templately – Elementor &amp; Gutenberg Template Library: 6500+ Free &amp; Pro Ready Templates And Cloud!, version 3.4.2. 30 lines.

- Page: https://pluginprobe.com/plugins/templately/3.4.2/code/includes/Utils/Views.php
- Raw: https://pluginprobe.com/plugins/templately/3.4.2/raw/includes/Utils/Views.php
- Modified: 2024-01-24T10:10:10+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/templately/3.4.2/code/includes/Utils/Views.php#L10-L20`.

```php
<?php

namespace Templately\Utils;

class Views extends Base {

	protected $dir = '';

	public function __construct( $path ) {
		$this->dir = trailingslashit($path);
	}

	public function get( string $template, array $args = [] ) {
		extract( $args );

		include $this->get_path( $template );
	}

	public function get_path( $template ): string {
		return $this->dir . $template . '.php';
	}

	public function get_header() {
		$this->get( 'templates/header' );
	}

	public function get_footer() {
		$this->get( 'templates/footer' );
	}
}
```
