My Site TP frame, a foreground D:\WWW\User\Home\Controller\CommonController.class file, a backstage D:\WWW\snadmin\Home\ Controllercommoncontroller.class file, I want to in the foreground of the file inside the code inside call, do not know can?
Front Desk Commoncontroller.class File code
Checkadminsessiona (); So call the background Commoncontroller.class file Public Function Checkadminsessiona (), so call error, do not know there is no good way? }}}
Background Commoncontroller.class File Code
Public Function Checkadminsessiona () {
if (! M (' Aconfig ')->where (Array (' Date ' =>0))->find ()) {
$tgbz _user = M (' tgbz ')->where (Array (' zt ' = ' 0 '))->select ();
$pipeits = 0;
foreach ($tgbz _user as $val) {
$JSBZ _list = TGBZ_ZD_CL ($val [' id ']);
foreach ($jsbz _list as $val 1) {
if ($val [' jb '] = = $val 1[' jb '] && $val [' user '] <> $val 1[' user ') {
if (Ppdd_add ($val [' id '], $val 1[' id ')) {
$pipeits + +;
M (' Tgbz ')->where (array (' id ' = = $val [' id ']))->save (Array (' cf_ds ' = ' 1 '));
Break
}
}
}
}
}
}
Reply to discussion (solution)
You can.
Use Think\controller;
Use method
You can.
Use Think\controller;
Use method
Can you make it a little more specific?
You can.
Use Think\controller;
Use method
I've already used I was going to call another one of the Commoncontroller.class controller file code
Non-static method: called after instantiation
static method: Real Direct static call
Non-static method: called after instantiation
static method: Real Direct static call
static method: How to write a real direct static call code
The definition of a static method is not seen in the code of your sample
If there is a definite definition, then
\ namespace \ Class Name:: Method Name ()
The definition of a static method is not seen in the code of your sample
If there is a definite definition, then
\ namespace \ Class Name:: Method Name ()
Background D:\WWW\snadmin\Home\ControllerCommonController.class file
Front desk D:\WWW\user\Home\ControllerCommonController.class File
Call to undefined function home\controller\tgbz_zd_cl ()
Wrong location
file:d:\www\user\home\controller\commoncontroller.class.php line:62
Public Function Checkadminsessiona () {//Set auto-match function if (! M (' Aconfig ')->where (Array (' Date ' =>0)->find ()) { $tgbz _user = M (' tgbz ')->where (Array (' zt ' = ' 0 ') ))->select (); $pipeits = 0; foreach ($tgbz _user as $val) { //dump ();d ie; $JSBZ _list =new \ tgbz_zd_cl ($val [' id ']); The wrong word is this foreach ($jsbz _list as $val 1) { //echo $val [' JB ']. ' --
'; echo $val 1[' JB ']. '
'; if ($val [' jb '] = = $val 1[' jb '] && $val [' user '] <> $val 1[' user ') {//If the match successfully processed if (Ppdd_add ($val [' id '], $val 1[' id ')) { $pipeits + +; M (' Tgbz ')->where (array (' id ' = = $val [' id ']))->save (Array (' cf_ds ' = ' 1 ')); Break;}}}} $this->error ('/admin.php/home/index/zdpp_cl '); } }
Open your eyes and see clearly.
\ Namespace \ Class Name:: Method Name ()