How to load a controller class from admin to controller class in catalog

331 views Asked by At

How to load a controller class from admin to controller class in catalog

/admin/controller/tool/getip.php

load function ip() from getip.php in: /catalog/controller/account/account.php

getip.php

class ControllerGetIp extends Controller {

public function ip() {

return ...;

}
...
}

account.php

class ControllerAccount extends Controller {

public function index() {

load ip();
..

}
1

There are 1 answers

1
Ganesh Negi On

Try to write the code below in your account controller

$ip = $this->load->controller('tool/getip');
$getip = $ip->ip();