推断首页函数的要领下(ps:测试5.3.1版本一般运用)
1、在模版文件module.php最低部到场以下代码
<?php //推断是不是是首页function blog_tool_ishome(){if (BLOG_URL . trim(Dispatcher::setPath(), '/') == BLOG_URL){ return true; } else { return FALSE;}}?>2、推断要领示例
<?php if (blog_tool_ishome()) :?>加载的文件代码<?php endif; ?>如果在首页不需要加载日记列表部份。则运用以下:
<?php if (blog_tool_ishome()) :?><?php include View::getView('index');?><?php else:?>加载日记列表部份<?php endif;?>

评论列表