Welcome Guest, Not a member yet? Register   Sign In
controller calling controller
#2

It is safe, though a little bit of a pain due to the classes that are injected in the controller's constructor, but you could do something like:

Code:
$otherController = new App\Controllers\OtherController($this->request, $this->response, $this->logger);

$otherController->doSomething();

However, I don't think it's required. See this blog post for ways to handle "modules" (yes, there will be a write-up in the user guide soon). With the new autoloader you can easily use any class it can find, so you can split the logic into as many libraries, entities, repositories, whatever you want, and access it that way.
Reply


Messages In This Thread
controller calling controller - by jaynarayan - 07-02-2016, 08:39 AM
RE: controller calling controller - by kilishan - 07-02-2016, 11:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB