Error – CodeIgniterViewExceptionsViewException
Invalid file: “/pergo/views/index.php”
SYSTEMPATHExceptionsFrameworkException.php at line 39
32 }
33
34 /**
35 * @return static
36 */
37 public static function forInvalidFile(string $path)
38 {
39 return new static(lang(‘Core.invalidFile’, [$path]));
My theme directory in root: ignore if i am wrong i am new in codings thing
Path
/themesmonoka
/themespergo
/themesregular
/themesviews
/themespergomodels
/themespergoviews
/themespergoviewsindex.php
View.php
<?php
namespace Config;
use CodeIgniterConfigView as BaseView;
class View extends BaseView
{
public array $paths = [
// Allow views to be loaded from the themes directory
ROOTPATH . 'themes',
APPPATH . 'views',
];
}
Home.php
<?php
namespace AppControllers;
use AppModelsLanguageModel;
use ConfigServices;
class Home extends BaseController
{
public function index()
{
if (session()->get('uid')) {
return redirect()->to('/new_order');
}
$homePageType = get_theme();
if (get_option('enable_disable_homepage') && $homePageType !== 'pergo') {
return redirect()->to('/auth/login');
}
$langModel = new LanguageModel();
$languages = $langModel
->where('status', 1)
->findAll();
// Load the index view from the active theme
$viewPath = "$homePageType/views/index";
return view($viewPath, [
'lang_current' => get_lang_code_defaut(),
'languages' => $languages,
]);
}
}