Skip to content

Commit 482732f

Browse files
committed
🔧 detect view engine and load file with extensions given
Signed-off-by: otengkwame <[email protected]>
1 parent b982fc2 commit 482732f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

MX/Loader.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,16 @@ public function _ci_load($_ci_data)
402402
extract($_ci_data);
403403

404404
$_is_view = false;
405-
$ext = 'php';
405+
$ext = (!empty(config_item('view')['view_engine']))
406+
? ltrim(config_item('plate_extension'), '.')
407+
: 'php';
406408

407409
if (isset($_ci_view)) {
408410
$_ci_path = '';
409411
$_is_view = true;
410412

411413
/* add file extension if not provided */
412-
$_ci_file = (pathinfo($_ci_view, PATHINFO_EXTENSION)) ? $_ci_view : $_ci_view . EXT;
414+
$_ci_file = (pathinfo($_ci_view, PATHINFO_EXTENSION)) ? $_ci_view : $_ci_view .'.'. $ext;
413415

414416
foreach ($this->_ci_view_paths as $path => $cascade) {
415417
if (file_exists($view = $path . $_ci_file)) {

0 commit comments

Comments
 (0)