Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Codeigniter 如何为静态和动态页面创建站点地图_Codeigniter_Sitemap_Codeigniter 3 - Fatal编程技术网

Codeigniter 如何为静态和动态页面创建站点地图

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

我已经使用CI framework 3.0创建了网站,但我仍然在为静态和动态页面创建xml站点地图。

您的问题非常清楚。我将codeigniter与sitemap php库一起使用。它很棒,并且有明确的方向:

要开始,请将SitemapPHP文件夹放在应用程序/库中

然后,在控制器中,在方法中调用库,如:

  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/');