ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilLTIRouterGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
32 {
33  protected ilCtrl $ilCtrl;
35 
36  public function __construct()
37  {
38  global $DIC;
39  $this->ilCtrl = $DIC->ctrl();
40  $this->main_tpl = $DIC->ui()->mainTemplate();
41  }
42 
47  public function executeCommand(): void
48  {
49  $next_class = $this->ilCtrl->getNextClass($this);
50  $class_file = '../' . ltrim($this->ilCtrl->lookupClassPath($next_class), './');
51 
52  if (is_file($class_file)) {
53  //ToDo: check - was $gui = $next_class::getInstance(); // Singleton!
54  $gui = $next_class::getInstance();
55  // $gui = call_user_func([$next_class, 'getInstance']);
56  $this->ilCtrl->forwardCommand($gui);
57  } else {
58  $this->main_tpl->setOnScreenMessage('failure', 'GUI-Class not found! (' . $next_class . ')');
59  }
60  }
61 }
ilGlobalTemplateInterface $main_tpl
Interface ilCtrlBaseClassInterface describes ilCtrl base classes.
executeCommand()
The only thing this execute Command does is forward the command in the command chain.
global $DIC
Definition: shib_login.php:25
Service ilViewRouterGUI This service is used by LTI.