Sitemap extends AbstractSitemap implements Sitemap
Interfaces, Classes and Traits
Table of Contents
- END = '</urlset>'
- End of sitemap.
- START = '<?xml version="1.0" encoding="UTF-8"?><urlset mlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">'
- Start of sitemap.
- $ext : string
- Extension.
- $lastMod : Datetime
- Last modify.
- $changeFreq : string
- Change frequency.
- $file : object
- resource.
- $priority : float
- Priority.
- $raw : string
- XML structure.
- $validFrequencies : array<string|int, mixed>
- Priority.
- __construct() : void
- __construct.
- addItem() : void
- Add item to sitemap.
- close() : void
- Close the sitemap file.
- delete() : object
- Delete the sitemap.
- has() : bool
- Determine whether the sitemap exists.
- read() : xml
- Read the sitemap file.
- write() : void
- Write on sitemap file.
- appendItem() : void
- Append item to sitemap.
- create() : bool
- Create the sitemap.
Constants
END
End of sitemap.
public
string
END
= '</urlset>'
Tags
START
Start of sitemap.
public
string
START
= '<?xml version="1.0" encoding="UTF-8"?><urlset mlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">'
Tags
Properties
$ext
Extension.
protected
string
$ext
= '.xml'
Tags
$lastMod
Last modify.
protected
Datetime
$lastMod
Tags
$changeFreq
Change frequency.
private
string
$changeFreq
= 'weekly'
Tags
$file
resource.
private
object
$file
Tags
$priority
Priority.
private
float
$priority
= 0.5
Tags
$raw
XML structure.
private
string
$raw
= '
<url>
<loc>:url</loc>
<lastmod>:lastmod</lastmod>
<changefreq>:changefreq</changefreq>
<priority>:priority</priority>
</url>'
Tags
$validFrequencies
Priority.
private
array<string|int, mixed>
$validFrequencies
= ['always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never']
Tags
Methods
__construct()
__construct.
public
__construct((string) $file) : void
Specify file name with extension, the path will be public.
Parameters
- $file : (string)
-
File name with extension (.xml).
Tags
Return values
void —addItem()
Add item to sitemap.
public
addItem((string) $url[, (string) $lastMod = null ][, (float) $priority = 0.5 ][, (string) $changeFreq = 'weekly' ]) : void
Parameters
- $url : (string)
-
Valid url.
- $lastMod : (string) = null
-
Last modify.
- $priority : (float) = 0.5
-
Priority.
- $changeFreq : (string) = 'weekly'
-
changeFreq.
Tags
Return values
void —close()
Close the sitemap file.
public
close() : void
Tags
Return values
void —delete()
Delete the sitemap.
public
delete((string) $file) : object
Parameters
- $file : (string)
-
File name with extension (.xml).
Tags
Return values
object —has()
Determine whether the sitemap exists.
public
has((string) $file) : bool
Parameters
- $file : (string)
-
File name with extension (.xml).
Tags
Return values
bool —read()
Read the sitemap file.
public
read() : xml
Tags
Return values
xml —write()
Write on sitemap file.
public
write((\alphaz\Common\Sitemap\xml) $data) : void
Parameters
- $data : (\alphaz\Common\Sitemap\xml)
-
Valid XML
Tags
Return values
void —appendItem()
Append item to sitemap.
private
appendItem((string) $url, (string) $lastMod, (float) $priority, (string) $changeFreq) : void
Parameters
- $url : (string)
-
Valid url.
- $lastMod : (string)
-
Last modify.
- $priority : (float)
-
Priority.
- $changeFreq : (string)
-
changeFreq.
Tags
Return values
void —create()
Create the sitemap.
private
create((\alphaz\Common\Sitemap\siring) $mode, (string) $url[, (string) $lastMod = null ][, (float) $priority = 0.5 ][, (string) $changeFreq = 'weekly' ]) : bool
Parameters
- $mode : (\alphaz\Common\Sitemap\siring)
-
Valid mode (for only access inside class)
- $url : (string)
-
Valid url.
- $lastMod : (string) = null
-
Last modify.
- $priority : (float) = 0.5
-
Priority.
- $changeFreq : (string) = 'weekly'
-
changeFreq.