CodeIgniter 4 Стук.

// in Controller, type this
$articleModel = new ArticleModel();
$data = [
            'articles' => $articleModel->orderBy('id', 'DESC')
            ->paginate(5),
            'pager' => $articleModel->pager
        ];

echo view('\(fileLocation)\(fileName)', $data); 
Alif Annas