Welcome Guest, Not a member yet? Register   Sign In
Execute a controller function inside other controller function
#1

[eluser]Unknown[/eluser]
Is possible to execute a controller function inside other controller function.

For isntance
I have 2 controller A,B

A->foo - function controller
B->bar - function.

I want to execut in A->foo , B->bar

class A
{
function foo()
{
....
B->bar

}
}
#2

[eluser]pistolPete[/eluser]
Either search this forum for "HMVC" or use the "traditional" PHP way:

Code:
<?php
require_once('B.php');
class A extends Controller {
   function foo()
   {
      $b = new B();
      $b->bar();
   }
}

You could also turn B into a library.




Theme © iAndrew 2016 - Forum software by © MyBB