WebSite-PHP Framework PHP
Multi langues
Mode Ajax simple
Aucun HTML, aucun JavaScript
URL rewrinting
Envoi d'email
Sitemap - RSS - Web service
Télécharger le Framework WebSite-PHP maintenant
 


Loading
 


Tutoriel Sitemap

Tutoriels

>

Tutoriel Sitemap



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

</urlset>

Fichier: /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
Accueil Documentation Télécharger Quick start Tutoriels Wiki Issue Tracker