Codeigniter 仅在index.php[CI]上显示欢迎消息
我用codeigniter脚本定制欢迎消息,但我只想在index.php上显示 我有Codeigniter 仅在index.php[CI]上显示欢迎消息,codeigniter,continuous-integration,Codeigniter,Continuous Integration,我用codeigniter脚本定制欢迎消息,但我只想在index.php上显示 我有 <div class="welcome"> <?php echo getConfigSetting('config_welcome') ?> </div> 此消息显示在所有页面的标题中。我只想在主页上显示(index.php) 我已经尝试过这个代码,但给我一个空
<div class="welcome">
<?php echo getConfigSetting('config_welcome') ?>
</div>
此消息显示在所有页面的标题中。我只想在主页上显示(index.php)
我已经尝试过这个代码,但给我一个空白页
<?php if( $this->uri->segment(1) == 'home' || $this->uri->segment(1) = '' ): ?>
负担得起的商业网站做得很快…
“只需找到一个您喜欢的网站,我们将根据您的业务需求对其进行定制,非常简单!”
开始搜索
</div>
</div>
有什么建议吗?
谢谢您可以尝试使用CI帮助器URL并获取URL的第一段以查看我们所在的whta页面 例如:
<?php if( $this->uri->segment(1) == 'home' || $this->uri->segment(1) = '' ): ?>
<div class="welcome">
<?php echo getConfigSetting('config_welcome') ?>
</div>
<?php endIf; ?>
当然,您希望将“home”更改为您在url中看到的主页名称,或默认控制器/方法名称
您还需要确保在配置/自动加载中自动加载url\u帮助程序。我输入此项,但给出空白页。