ppoo24 发表于 2010-11-24 20:41:16

CI是直接include或者eval页面内容的,见Loader.php中:

if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE)
                {
                        echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('<?=', '<?php echo ', file_get_contents($_ci_path))));
                }
                else
                {
                        include($_ci_path); // include() vs include_once() allows for multiple views with the same name
                }

而PHP的include在当一个文件被包含时,语法解析器在目标文件的开头脱离 PHP 模式并进入 HTML 模式,到文件结尾处恢复,所以页面得以显示
页: 1 [2]
查看完整版本: ci的view层里面的文件后缀怎么改?