| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* E2pdf Post Helper |
| 5 |
* |
| 6 |
* @copyright Copyright 2017 https://e2pdf.com |
| 7 |
* @license GPL v2 |
| 8 |
* @version 1 |
| 9 |
* @link https://e2pdf.com |
| 10 |
* @since 0.00.01 |
| 11 |
*/ |
| 12 |
if (!defined('ABSPATH')) { |
| 13 |
die('Access denied.'); |
| 14 |
} |
| 15 |
|
| 16 |
class Helper_E2pdf_Tplargs { |
| 17 |
|
| 18 |
private $tpl_args = array(); |
| 19 |
|
| 20 |
/** |
| 21 |
* On init |
| 22 |
* Assign Tpl args |
| 23 |
* |
| 24 |
* @param array $tpl_args - List of arguments |
| 25 |
*/ |
| 26 |
public function __construct($tpl_args = array()) { |
| 27 |
$this->tpl_args = $tpl_args; |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Get Tpl Value |
| 32 |
* |
| 33 |
* @param string $key - Tpl key |
| 34 |
* |
| 35 |
* @return mixed - Tpl value |
| 36 |
*/ |
| 37 |
public function get($key = false) { |
| 38 |
if (!$key) { |
| 39 |
if (!empty($this->tpl_args)) { |
| 40 |
return $this->tpl_args; |
| 41 |
} else { |
| 42 |
return array(); |
| 43 |
} |
| 44 |
} else { |
| 45 |
|
| 46 |
if (isset($this->tpl_args[$key])) { |
| 47 |
return $this->tpl_args[$key]; |
| 48 |
} else { |
| 49 |
return null; |
| 50 |
} |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
} |
| 55 |
|