简体   繁体   中英

How to use evert/sitemap yii2 without using composer?

hi i want to add evert/sitemap to my project to create my website sitemap. i downloaded sitemap-php-master zip from https://github.com/evert/sitemap-php and extract it into vendor. i added below code to composer.json

"require": {.., "evert/sitemap-php",}

then i added to vendor/composer/autoload_psr4.php below code

'evert\\sitemap-php\\' => array($vendorDir . '/evert/sitemap-php'),

and add below code to yiisoft/extensions

<?
.
.
.
    'evert/sitemap-php' => array (
    'name' => 'evert/sitemap-php',
    'version' => '2',
    'alias' => array (
        '@evert/sitemap-php' => $vendorDir . '/evert/sitemap-php',
    ),
),
?>

how can i use this sitemap in my reports? i should add sitemap in my controllers/ReportsController?

Use the composer installed in the system.

cd /var/www/projectx/
# if you are running with phar file
php composer.phar require --prefer-dist evert/sitemap
#if you run with exe
composer require --prefer-dist evert/sitemap

Or you can add to composer.json file in the root of your project.

    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "~2.0.6",
        "yiisoft/yii2-bootstrap": "~2.0.0",
        "yiisoft/yii2-swiftmailer": "~2.0.0",
        "guzzlehttp/guzzle": ">=4.1.4 <7.0",
        "flow/jsonpath": "*",
        "evert/sitemap": "*"
},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM