mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-20 22:39:55 +02:00
Template executor interface defines a template executor object. It is an object which can execute (i.e. display/render) a template. Currently there are two implementations: * phpbb_template_executor_include includes php code from a file. * phpbb_template_executor_eval eval's php code. PHPBB3-9726
33 lines
618 B
PHP
33 lines
618 B
PHP
<?php
|
|
|
|
/**
|
|
* Template executor that stores path to php file with template code
|
|
* and evaluates it by including the file.
|
|
*/
|
|
class phpbb_template_executor_include implements phpbb_template_executor
|
|
{
|
|
/**
|
|
* Template path to be included.
|
|
*/
|
|
private $path;
|
|
|
|
/**
|
|
* Constructor. Stores path to the template for future inclusion.
|
|
*
|
|
* @param string $path path to the template
|
|
*/
|
|
public function __construct($path)
|
|
{
|
|
$this->path = $path;
|
|
}
|
|
|
|
/**
|
|
* Executes the template managed by this executor by including
|
|
* the php file containing the template.
|
|
*/
|
|
public function execute()
|
|
{
|
|
include($this->path);
|
|
}
|
|
}
|