2016-11-16 3 views
0

私はCIフレームワーク3.0を使用してウェブサイトを作成しましたが、静的および動的ページ用のXMLサイトマップを作成することに固執しています。静的および動的ページのサイトマップを作成する方法

+1

スタックオーバーフローへようこそ!あなたの質問にはほとんど情報がありません。私はあなたのコードや設定を示すためにそれを編集することをお勧めします。問題を診断するために必要な情報を提供してください。 –

答えて

0

あなたの質問は非常に明確です。私はサイトマップphpライブラリでcodeigniterを使用しています。その素晴らしいと明確な方向性があります:あなたが開始するにはhttps://github.com/evert/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 

} 
関連する問題