| Total Complexity | 2 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | /** |
||
| 18 | * Array of opening and closing tags for raw echos. |
||
| 19 | * |
||
| 20 | * @var array |
||
| 21 | */ |
||
| 22 | protected $rawTags = ['<%', '%>']; |
||
| 23 | |||
| 24 | |||
| 25 | /** |
||
| 26 | * Array of opening and closing tags for regular echos. |
||
| 27 | * |
||
| 28 | * @var array |
||
| 29 | */ |
||
| 30 | // protected $contentTags = ['<%', '%>']; |
||
|
|
|||
| 31 | |||
| 32 | /** |
||
| 33 | * Array of opening and closing tags for escaped echos. |
||
| 34 | * |
||
| 35 | * @var array |
||
| 36 | */ |
||
| 37 | protected $escapedTags = ['<%%%', '%%%>']; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * The "regular" / legacy echo string format. |
||
| 41 | * |
||
| 42 | * @var string |
||
| 43 | */ |
||
| 44 | protected $echoFormat = 'e(%s)'; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Array of footer lines to be added to template. |
||
| 48 | * |
||
| 49 | * @var array |
||
| 50 | */ |
||
| 51 | protected $footer = []; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Array to temporary store the raw blocks found in the template. |
||
| 55 | * |
||
| 56 | * @var array |
||
| 57 | */ |
||
| 58 | protected $rawBlocks = []; |
||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | public function compileFileName($fileName, $model) { |
||
| 63 | $parsed = $this->compileString($fileName); |
||
| 64 | ob_start(); |
||
| 65 | eval( '?>' . $parsed ); |
||
| 66 | $output = ob_get_contents(); |
||
| 67 | ob_end_clean(); |
||
| 68 | return $output; |
||
| 69 | } |
||
| 70 | |||
| 71 | public function compileFile($filePath, $model) |
||
| 72 | { |
||
| 73 | return Code::file($filePath)->with(['model'=>$model])->render(); |
||
| 74 | } |
||
| 75 | } |