Hi,
I'm confusing about DIRECTORY_SEPARATOR.
I encountered some errors in folder structure during theme usage. Here is my folder structure.
Code:
├───app
├───public
├───system
├───ThirdParty
│ └───Site
│ ├───Config
│ ├───Controllers
│ │ └───Common
│ ├───Database
│ │ ├───Migrations
│ │ └───Seeds
│ ├───Helpers
│ ├───Language
│ ├───Models
│ └───Views
│ └───theme
│ └───jango
│ ├───assets
│ └───common
└───writable
When i try to reach my headerView.php codeigniter shows error "Invalid file: Site\Views\theme\jango\common\headerView.php
After some research i found some code blocks under FileLocator (system/Autoloader/FileLocator.php)
PHP Code:
protected function getNamespaces(string $prefix = null) {
if ($prefix) {
$path = $this->autoloader->getNamespace($prefix);
return isset($path[0])
? rtrim($path[0], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR
: '';
}
$namespaces = [];
foreach ($this->autoloader->getNamespace() as $prefix => $paths) {
foreach ($paths as $path) {
$namespaces[] = [
'prefix' => $prefix,
'path' => rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR,
];
}
}
return $namespaces;
}
when i change
Code:
? rtrim($path[0], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR
to
? rtrim($path[0], DIRECTORY_SEPARATOR) . '/'
my problem solves. But it's core file. Do i have to change ?
I'm using Windows 10 and Lastest version of WAMP (3.1.9), PHP 7.3.5
Best Wishes