定制 keiii/silex-sitemap 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

keiii/silex-sitemap

最新稳定版本:2.0.1

Composer 安装命令:

composer require keiii/silex-sitemap

包简介

Provides service for generate sitemap.xml

README 文档

README

Build Status

Provides sitemap-php service for Silex microframework.

Installation

composer require keiii/silex-sitemap

How to use

<?php

require_once __DIR__.'/vendor/autoload.php';

$app = new \Silex\Application();
$app->register(new \KEIII\SilexSitemap\SitemapServiceProvider(), array(
    'sitemap.domain' => 'http://example.com',
    'sitemap.path' => __DIR__,
    'sitemap.loc' => 'http://example.com/',
));

/** @var \KEIII\SilexSitemap\Sitemap $sitemap */
$sitemap = $app['sitemap'];

for ($i = 0; $i < 51000; $i++) {
    $item = (new \KEIII\SilexSitemap\SitemapItem())
        ->setLoc('/')
        ->setPriority(1.0)
        ->setChangefreq('daily')
        ->setLastmod(new \DateTime())
    ;
    $sitemap->addItem($item);
}

$sitemap->create();

When you run your script, it generates and saves XML files to given path.

统计信息

  • 总下载量: 6.48k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-01