src/Controller/SitemapController.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Journal;
  4. use Doctrine\ORM\EntityManagerInterface;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  9. class SitemapController extends AbstractController
  10. {
  11.     /**
  12.      * @Route("/sitemap.xml", name="app_sitemap")
  13.      */
  14.     public function index(EntityManagerInterface $em): Response
  15.     {
  16.         ini_set('memory_limit''512M');
  17.         // $ids = [];
  18. //        $journals = $em->getRepository(Journal::class)->findAll();
  19.         $journals $em->getRepository(Journal::class)->limitedJournals(100);
  20.         $pages = [
  21.             '',
  22.             '/journal-search',
  23.             '/authors',
  24.             '/advanced-search',
  25.             '/blog',
  26.             '/faq',
  27.             '/about-us',
  28.             '/contact-us',
  29.             '/legal-notice',
  30.             '/privacy-policy',
  31.             '/verified-journal',
  32.             '/top-journals-list',
  33.             '/user-registration',
  34.             '/indexing-services',
  35.             '/help-researchguide',
  36.         ];
  37.         $articles = [
  38.             'how-to-verify-indexed-journals-in-scopus-and-web-of-science',
  39.             'what-is-scopus-database',
  40.             'automation',
  41.             'what-role-has-technology-in-the-fights-against-covid19',
  42.             'the-internet-of-things',
  43.             'how-to-create-a-professional-chart-with-graph-maker-of-researchguide-net',
  44.             'indexed-journal-what-does-it-mean',
  45.             'how-to-publish-article-in-journal',
  46.             'the-profound-benefits-of-scientific-research-shaping-our-world-for-a-better-future',
  47.         ];
  48.        
  49.         return $this->render('sitemap/index.html.twig', [
  50.             'journals' => $journals,
  51.             'pages' => $pages,
  52.             'articles' => $articles
  53.         ]);
  54.         
  55.     }
  56. }