如何将两个功能组合成一个(Symfony 4)?

I am trying to combine this function...

public function index()
    {
      return $this->render('pages/index.html.twig', ['controller_name' => 'PagesController',]);
    }

...with this function:

public function index()
{
  $pages = $this->getDoctrine()->getRepository(Pages::class)->findAll();
    return $this->render('pages/index.html.twig', array('pages' => $pages));
}

This is my approach:

public function index()
{
    $pages = $this->getDoctrine()->getRepository(Pages::class)->findAll();
    return $this->render('pages/index.html.twig', array('pages' => $pages),['controller_name' => 'PagesController',]);
}

But I get just an error message:

Argument 3 passed to Symfony\Bundle\FrameworkBundle\Controller\Controller::render() must be an instance of Symfony\Component\HttpFoundation\Response or null, array given, called in /Users/work/project/src/Controller/PagesController.php on line 18

Instead of passing a third argument, you should be combining all the data that you want to pass to the view into one array.

public function index()
{
    $pages = $this->getDoctrine()->getRepository(Pages::class)->findAll();
    return $this->render('pages/index.html.twig', array('pages' => $pages, 'controller_name' => 'PagesController'));
}