Welcome Guest, Not a member yet? Register   Sign In
Problem with configurations from modules in services after update to 4.1.1
#1

(This post was last modified: 03-04-2021, 05:16 AM by slagman.)

After upgrading from 4.0.4 to 4.1.1 I have a problem with configurations for services.
When I want to use custom configuration file specific only for backend, located in the "admin" module,
for example:


$pager = \Config\Services::pager(new \Admin\Config\Pager());;

I receive the following error message:
Argument 1 passed to CodeIgniter\Config\Services::validation () must be an instance of Config\Pager
 or null, instance of Admin\Config\Pager given

Why can't I use the configuration file located in Admin\Config as before the update?
Reply
#2

Based on answer from John Paul Balandan on codeigniterchat.slack:

It is necessary to extending Admin\Config\Pager from Config\Pager, not simply extending from BaseConfig.

Class Pager in config file admin/Config/Pager.php, must be defined as follows:

Code:
namespace Admin\Config;

use Config\Pager as BasePager;

class Pager extends BasePager
{
// ...
}
Reply




Theme © iAndrew 2016 - Forum software by © MyBB