codeigniter+HMVC cross module call controller->method

前端 未结 7 1088
有刺的猬
有刺的猬 2020-12-16 01:32

I am pulling all my hair off... Have been searching every thread, would appreciate if someone can point me to a working example.

Accroding to the doc: https://bitbuc

相关标签:
7条回答
  • 2020-12-16 02:23
      /*echo Modules::run("controller name of a module which you want to call/and its.. function name");*/
    
    echo Modules::run("Second/callit");
    

    or

    $this->load->module('Second');
    
    $this->second->callit();
    

    But.. the controller name shold be different .. from one module to another module..

                           **(parameter passing)**
    
            echo "<hr>";
    
           //echo Modules::run("controller name of a module which you want to call/and its.. function name");
    
             $data="peter";
    
          echo Modules::run("Second/callit",$data);
    
          echo "<hr>";
    
          $this->load->module('Second');
    
         $this->second->callit($data);
    
          echo "<hr>";
    
    0 讨论(0)
提交回复
热议问题