Php 在主页上显示内容,但不是所有页面的内容
我使用的是CakePHP1.3,我想让我的图片幻灯片只显示在我的主页上。 我正在使用以下代码:Php 在主页上显示内容,但不是所有页面的内容,php,cakephp-1.3,Php,Cakephp 1.3,我使用的是CakePHP1.3,我想让我的图片幻灯片只显示在我的主页上。 我正在使用以下代码: <?php if($page == 'home'){ ?> //The content of slider here <?php }else{ ?> the message that the slider is only avaliable on homepage... or blank <?php } ?> 有人能帮忙吗?将您的初始if()改
<?php
if($page == 'home'){
?>
//The content of slider here
<?php
}else{
?>
the message that the slider is only avaliable on homepage... or blank
<?php
}
?>
有人能帮忙吗?将您的初始if()改为
这将删除警告
Undefined variable: page [APP\views\elements\header_layout.ctp, line 38]
if (isset($page) && ($page == 'home')) {
...
}