Codeigniter 如何为静态和动态页面创建站点地图
我已经使用CI framework 3.0创建了网站,但我仍然在为静态和动态页面创建xml站点地图。您的问题非常清楚。我将codeigniter与sitemap php库一起使用。它很棒,并且有明确的方向: 要开始,请将SitemapPHP文件夹放在应用程序/库中 然后,在控制器中,在方法中调用库,如:Codeigniter 如何为静态和动态页面创建站点地图,codeigniter,sitemap,codeigniter-3,Codeigniter,Sitemap,Codeigniter 3,我已经使用CI framework 3.0创建了网站,但我仍然在为静态和动态页面创建xml站点地图。您的问题非常清楚。我将codeigniter与sitemap php库一起使用。它很棒,并且有明确的方向: 要开始,请将SitemapPHP文件夹放在应用程序/库中 然后,在控制器中,在方法中调用库,如: public function makeSitemap() { // APPPATH will automatically figure out the correct p
public function makeSitemap()
{
// APPPATH will automatically figure out the correct path
include APPPATH.'libraries/SitemapPHP/Sitemap.php';
// your website url
$sitemap = new Sitemap('http://yourwebsite.com');
// This will also need to be set by you.
// the full server path to the sitemap folder
$sitemap->setPath('/home/username/public_html/sitemap/');
// the name of the file that is being written to
$sitemap->setFilename('mysitemap');
// etc etc etc
}
欢迎来到堆栈溢出!你的问题中没有多少信息。我建议您向我们展示您的代码和/或配置。帮助我们帮助您:尝试为我们提供诊断问题所需的信息。我收到了以下错误“无法找到指定的类:Session.php”,尽管我已经自动加载了会话,并且通过var_dump()检查了数据打印是否正常。我认为这是问题的根源$sitemap=newsitemap('localhost/tickets/');