| 1 |
<?php namespace Datafeedr\Api\Wuwei\Templates; |
| 2 |
|
| 3 |
/** |
| 4 |
* Template_Generic class. |
| 5 |
* |
| 6 |
* Extends the Template_Abstract class. Handles the get_file() and get_data() requests. |
| 7 |
* |
| 8 |
* @since 2.0.0 |
| 9 |
*/ |
| 10 |
class Generic extends Template { |
| 11 |
|
| 12 |
/** |
| 13 |
* Returns full path to generic template file. |
| 14 |
* |
| 15 |
* @since 2.0.0 |
| 16 |
* |
| 17 |
* @return string Full path to template file. |
| 18 |
*/ |
| 19 |
public function get_file() { |
| 20 |
$ds = \DIRECTORY_SEPARATOR; |
| 21 |
$path = realpath( __DIR__ . '/..' ) . $ds . 'Views' . $ds . 'generic' . $ds; // Requires PHP 5.3+ |
| 22 |
$file = $path . $this->name; |
| 23 |
|
| 24 |
return $file; |
| 25 |
} |
| 26 |
|
| 27 |
/** |
| 28 |
* Returns the array of data to use in our templates. |
| 29 |
* |
| 30 |
* @since 2.0.0 |
| 31 |
* |
| 32 |
* @return array The data for use in our template file. |
| 33 |
*/ |
| 34 |
public function get_data() { |
| 35 |
return $this->data; |
| 36 |
} |
| 37 |
} |
| 38 |
|