CodeIgniter Forums
codeigniter 3.1.10 index.php code is not concise - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forum-17.html)
+--- Thread: codeigniter 3.1.10 index.php code is not concise (/thread-73382.html)



codeigniter 3.1.10 index.php code is not concise - hap2000 - 04-18-2019

codeigniter 3.1.10 index.php code is not concise,duplicate code in many.
$application_folder = strtr(
rtrim($application_folder, '/\\'),
'/\\',
DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
);
Why not deal with it in one place?
for example:
arr=[dir1,dir2,dir3];
foreach($arr as $k=>$v) {
$arr[$k]= strtr(
rtrim($v, '/\\'),
'/\\',
DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
}


RE: codeigniter 3.1.10 index.php code is not concise - php_rocs - 04-18-2019

@hap2000,

If you have a suggestion, you could always go to github and do a PR for the next version.