本文整理汇总了PHP中Sitemap::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Sitemap::instance方法的具体用法?PHP Sitemap::instance怎么用?PHP Sitemap::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sitemap
的用法示例。
在下文中一共展示了Sitemap::instance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance
/**
* create an instance of Sitemap_Base using sitemap
*
* @return void
* @author Andy Bennett
*/
public static function instance()
{
if (self::$instance == NULL) {
self::$instance = Sitemap_Base::factory('sitemap');
}
return self::$instance;
}
示例2: getInstance
public static function getInstance()
{
if (!self::$instance && !is_object(self::$instance)) {
self::$instance = new self();
}
return self::$instance;
}
示例3: get_pages
/**
* get a list of pages
*
* @return void
* @author Andy Bennett
*/
public function get_pages()
{
$map = Sitemap::instance()->get_sitemap();
$pages = $map->xpath('/root//item');
$arr = array();
foreach ($pages as $page) {
$tmp = new stdClass();
$tmp->id = (string) $page->name;
$tmp->title = (string) $page->title;
$arr[] = $tmp;
}
return $arr;
}
示例4: index
/**
* simple test to show navigation
*
* @return void
* @author Andy Bennett
*/
public function index()
{
echo '<style type="text/css" media="screen">
ul { clear: left; background: #ccc; height: 30px; }
li { list-style: none; float: left; line-height: 30px; height: 30px; }
li.current { background: white; color: red; }
li span { margin-top: 5px; display: block; border-right: 1px solid red; line-height: 16px; padding: 2px 1em; }
li.last span { border-right: none; }
li a { color: black; text-decoration: none; }
li a:hover { text-decoration: underline; }
</style>';
echo Sitemap::instance()->navigation(2, 0);
}
示例5: index
function index()
{
Sitemap::instance()->google();
}
示例6: save
/**
* pass the edited tree to the sitemap to be saved
*
* @return void
* @author Andy Bennett
*/
public function save()
{
$tree = Input::instance()->post('tree');
$xml_string = tree_helper::return_xml_string($tree);
echo Sitemap::instance()->save_sitemap($xml_string) ? 'Saved successfully' : 0;
}