WebSite-PHP Framework PHP
Multi language
Simple Ajax mode
No HTML, no JavaScript
URL rewriting
Mail sending
Sitemap - RSS - Web service
Download WebSite-PHP FrameWork now
 


Loading
 


Tutorial Sitemap

Tutorials

>

Tutorial Sitemap



Tutorial 1 : Simple SiteMap
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>https://www.website-php.com/</loc>
<lastmod>2024-04-24</lastmod>
<changefreq>hourly</changefreq>
<priority>1</priority>
</url>

</urlset>

File: /pages/tutorials/sitemap/sitemap-01.php

<?php
// Use: http://YOUR_DOMAIN/tutorials/sitemap/sitemap-01.xml

class Sitemap01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Simple SiteMap";
        
        
$sitemap = new GoogleSitemap();
        
$sitemap->addItem(
            new 
GoogleSitemapItem(
                
$this->getBaseURL(), 
                new 
DateTime(), 
                
GoogleSitemap::CHANGEFREQ_HOURLY"1"
            
)
        );
        
        
$this->render $sitemap;
    }
}
?>



Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Home Documentation Download Quick start Tutorials Wiki Issue Tracker