原 服务器搭建
|-摘 Yii2生成sitemap,yii2-sitemap-module Yii2 module for automatically generating XML Sitemap
两个都是Yii2的扩展https://www.yiiframework.com/extension/mubat/yii2-sitemap-generator mubat/yii2-sitemap-generatorYii2 widget for sitemap generationyii2-sitemap-generatorSimple widget forYii2 frameworkto generate sitemap. SupportXMLformat generation. Support multi language. InstallationComposerThe preferred way to install this extension is throughComposer. Either run`php composer require mubat/yii2-sitemap-generator` or add`"mubat/yii2-sitemap-generator" : "~1.0"to the require section of yourcomposer.json` Widget contains 2 models: Sitemap- base model. It containsSitemapElementarray and methods to generate XML. If$languagesarray published, model will generate'alternate'links. SitemapElement- represents one<url>element. It contains: $loc-requrired- page url (as array). Before insert into XML it will be process byyii2\helpers\Url::toRoute()method. $updated_at-optional- last page update; $changefreq-requrired, default'weekly'- from class constant. $priority-requrired, default0.4- page priority. https://www.yiiframework.com/extension/yii2-sitemap-module yii2-sitemap-moduleYii2 module for automatically generating XML SitemapInstallationUsageResourcesYii2 module for automatically generatingXML Sitemap.InstallationThe preferred way to install this extension is throughcomposer.Either runphp composer.phar require --prefer-dist "himiklab/yii2-sitemap-module" "*" or add"himiklab/yii2-sitemap-module" : "*" to the require section of your application'scomposer.jsonfile.UsageConfigure thecachecomponent of your application's configuration file, for example:'components' => [ 'cache' => [ 'class' => 'yii\caching\FileCache', ], ] Add a new module inmodulessection of your application's configuration file, for example:'modules' => [ 'sitemap' => [ 'class' => 'himiklab\sitemap\Sitemap', 'models' => [ // your models 'app\modules\news\models\News', ], 'urls'=> [ // your additional urls [ 'loc' => '/news/index', 'changefreq' => \himiklab\sitemap\behaviors\SitemapBehavior::CHANGEFREQ_DAI***, 'priority' => 0.8, 'news' => [ 'publication' => [两个都是Yii2的扩展https://www.yiiframework.com/extension/mubat/yii2-sitemap-generator mubat/yii2-s...
浏览更多内容请先登录。
立即注册
更新于:2020-03-29 01:13:31
相关内容
域名解析
打不开Godaddy.com网站和域名无法解析的解决方法
GoDaddy DNS问题导致域名解析不正常的解决办法
godaddy 无法登录 Your browser is a bit unusual... Please try the foll...
推荐内容