Answer the question
In order to leave comments, you need to log in
How to enable the sitemap module?
Hello. I want to install this extension , I installed it via composer, I connected it to console\config\main in components
'components' => [
'log' => [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'sitemap' =>[
'class' => '\zhelyabuzhsky\sitemap\components\Sitemap',
'maxUrlsCountInFile' => 10000,
'sitemapDirectory' => 'frontend/web',
'optionalAttributes' => ['changefreq', 'lastmod', 'priority'],
'maxFileSize' => '10M',
],
],
namespace console\controllers;
use yii\console\Controller;
class SitemapController extends Controller
{
public function actionCreateSitemap()
{
\Yii::$app->sitemap
->addModel(\common\models\product\Product::className())
->create();
}
}
Answer the question
In order to leave comments, you need to log in
well, probably call the controller action that you created./yii sitemap/create-sitemap
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question