我已经安装并正确运行了CodeIgniter。我的应用程序正在加载控制器并显示视图。
然而,如果像以前一样使用短标签
我是否应该包含完整标签
PHP必须在某个时刻被解析,因为当使用短标签时,控制器仍然可以正确加载但产生未解析短标签的HTML。可能出现了什么问题?
然而,如果像以前一样使用短标签
<?=base_url()?>
,这个版本不会将它们解析为PHP。我是否应该包含完整标签
<?php echo base_url(); ?>
?当使用短标签时,执行立即停止在第一个PHP标签处。PHP必须在某个时刻被解析,因为当使用短标签时,控制器仍然可以正确加载但产生未解析短标签的HTML。可能出现了什么问题?
<div id="container">
<div id="content">
<img src="<?=base_url() . 'assets/images/cool_critter_logo_trans.png'?>"
alt="Cool Critters Logo" id="logo_image" />
<h1>Welcome to Cool Critters!</h1>
<p>
This website is undergoing some serious updates! Please be patient as we work behind the scenes
to improve the functionality and look of the website!
</p>
<p>
Cool Critters is your source for dog training and agility supplies, courses, and information.
</p>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>
</div>
</div>
这在之前的另一台服务器上能够正常运行,但我在转移时弄坏了某些东西。
可在此处找到:http://107.21.96.179:81/
$this->load->helper('url');
。 - gen_Eric/applications/logs/
目录(如果在配置文件中启用了日志记录)或者你的 PHP 错误日志。 - stealthyninja