phpDocumentor Swift
[ class tree: Swift ] [ index: Swift ] [ all elements ]

Class: SwiftSitemap

Source Location: /classes/SwiftSitemap.php

Class SwiftSitemap

Class Overview

This class contains functions to create a dynamic sitemap.xml file on the fly.

Located in /classes/SwiftSitemap.php [line 42]



		
		
		
		

Methods

[ Top ]
Method Summary
SwiftSitemap   __construct()   Create and load a new Sitemap object. If filename to an existing XML Sitemap is provided then it will be loaded into our object. Otherwise, if a URL to an existing stylesheet is provided, then an empty Sitemap object will be setup with the given stylesheet used.
void   addUrl()   Add a new URL element to this Sitemap object.
integer   getCount()   Get the number of URL items in this Sitemap object.
array   getUrlByLoc()   Get any URL item by the provided location (URL)
array   getUrls()   Get the array of all URLs in this Sitemap object.
string   getXml()   Get the Sitemap as XML
void   load()   Load an existing well formated XML sitemap file into this Sitemap object, or load an empty skeleton sitemap to for us to fill with elements.
boolean   removeUrlByLoc()   Remove any URL item from the Sitemap by providing it's location/URL.
string   writeXml()   Write the current Sitemap object to a XML file.

[ Top ]
Methods
Constructor __construct  [line 56]

  SwiftSitemap __construct( [string $filename = null], [string $stylesheet = null]  )

Create and load a new Sitemap object. If filename to an existing XML Sitemap is provided then it will be loaded into our object. Otherwise, if a URL to an existing stylesheet is provided, then an empty Sitemap object will be setup with the given stylesheet used.

Parameters:
string   $filename:  The filename or URI to the XML Sitemap feed.
string   $stylesheet:  The stylesheet to use if loading a new sitemap (optional).

API Tags:
Return:  The new SwiftSitemap object
Access:  public


[ Top ]
addUrl  [line 88]

  void addUrl( string $loc, string $lastMod, string $changeFreq, [string $priority = null]  )

Add a new URL element to this Sitemap object.

Parameters:
string   $loc:  The location of this URL.
string   $lastMod:  The last modification date of the URL.
string   $changeFreq:  The change frequency (e.g. daily,weekly,monthly)
string   $priority:  The value of priority from 0 to 1. (e.g. 0.5 = 50% priority)

API Tags:
Access:  public


[ Top ]
getCount  [line 113]

  integer getCount( )

Get the number of URL items in this Sitemap object.


API Tags:
Return:  Integer count of URL items.
Access:  public


[ Top ]
getUrlByLoc  [line 122]

  array getUrlByLoc( string $loc  )

Get any URL item by the provided location (URL)

Parameters:
string   $loc:  The location or URL

API Tags:
Return:  The URL item
Access:  public


[ Top ]
getUrls  [line 105]

  array getUrls( )

Get the array of all URLs in this Sitemap object.


API Tags:
Return:  Array of all URLs.
Access:  public


[ Top ]
getXml  [line 161]

  string getXml( )

Get the Sitemap as XML


API Tags:
Return:  XML output for this Sitemap.
Access:  public


[ Top ]
load  [line 66]

  void load( [string $filename = null], [string $stylesheet = null]  )

Load an existing well formated XML sitemap file into this Sitemap object, or load an empty skeleton sitemap to for us to fill with elements.

Parameters:
string   $filename:  The filename or URI to the XML Sitemap feed.
string   $stylesheet:  The stylesheet to use if loading a new sitemap (optional).

API Tags:
Access:  public


[ Top ]
removeUrlByLoc  [line 135]

  boolean removeUrlByLoc( string $loc  )

Remove any URL item from the Sitemap by providing it's location/URL.

Parameters:
string   $loc:  The location or URL

API Tags:
Return:  True if succesfully removed, otherwise false.
Access:  public


[ Top ]
writeXml  [line 153]

  string writeXml( string $filename  )

Write the current Sitemap object to a XML file.

Parameters:
string   $filename:  Filename to write to.

API Tags:
Return:  XML output for this Sitemap.
Access:  public


[ Top ]

Documentation generated on Tue, 08 Oct 2013 05:37:16 +0200 by phpDocumentor 1.4.4