| Total Complexity | 6 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | abstract class SimpleViewController extends Controller { |
||
| 15 | |||
| 16 | public function __construct() { |
||
| 17 | } |
||
| 18 | |||
| 19 | protected function _includeFileAsString($filename, $pData) { |
||
| 20 | if (isset ( $pData )) { |
||
| 21 | \extract ( $pData ); |
||
| 22 | } |
||
| 23 | \ob_start (); |
||
| 24 | include ($filename); |
||
| 25 | return \ob_get_clean (); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Loads the php view $viewName possibly passing the variables $pdata |
||
| 30 | * |
||
| 31 | * @param string $viewName The name of the view to load |
||
| 32 | * @param mixed $pData Variable or associative array to pass to the view |
||
| 33 | * If a variable is passed, it will have the name **$data** in the view, |
||
| 34 | * If an associative array is passed, the view retrieves variables from the table's key names |
||
| 35 | * @param boolean $asString If true, the view is not displayed but returned as a string (usable in a variable) |
||
| 36 | * @throws \Exception |
||
| 37 | * @return string null or the view content if **$asString** parameter is true |
||
| 38 | */ |
||
| 39 | public function loadView($viewName, $pData = NULL, $asString = false) { |
||
| 48 | } |
||
| 49 | } |
||
| 50 |