"; print_r( $a ); echo ""; } use yii\base\BootstrapInterface; use yii; use yii\base\Module; class Sitemap extends Module implements BootstrapInterface { public $layout = "@sitemap/views/main.php"; // public $defaultRoute = 'default'; public function init() { parent::init(); // $this->bootstrap(); } /** * {@inheritdoc} */ public function bootstrap($app) { // parent::bootstrap($app); $prefix = '/'; if ($urlManager = $app->getUrlManager() && 0) { $urlManager->addRules([ // $prefix . 'id . '>///' => '//', $prefix . 'id . '>//' => '//', $prefix . 'id . '>/' => '//index', ], true); } $app->getUrlManager()->addRules([ [ 'pattern' => 'sitemap/sitemap', 'route' => '/sitemap/default/index', 'suffix' => '.xml' ], 'sitemap/sitemap.xml' => 'sitemap/default/index', 'sitemap/news/' => 'sitemap/default/news' ], true); } }