Пример #1
0
 function invokeView($target)
 {
     $namespace = core\ApplicationRegistry::getNamespaceRoot();
     $filePath = $_SERVER["DOCUMENT_ROOT"] . DIRECTORY_SEPARATOR;
     $filePath .= $namespace . DIRECTORY_SEPARATOR;
     $filePath .= "view" . DIRECTORY_SEPARATOR;
     $filePath .= "{$target}.php";
     include $filePath;
 }
Пример #2
0
 function resolveCommand($cmd)
 {
     $classroot = $this->controllerMap->getClassroot($cmd);
     $namespaceRoot = core\ApplicationRegistry::getNamespaceRoot();
     $filepath = core\HelperFunctions::replaceSlashes("{$namespaceRoot}/command/{$classroot}.php");
     $classname = "\\{$namespaceRoot}\\command\\{$classroot}";
     if (file_exists($filepath)) {
         require_once $filepath;
         if (class_exists($classname)) {
             $cmd_class = new \ReflectionClass($classname);
             if ($cmd_class->isSubClassOf(self::$base_cmd)) {
                 return $cmd_class->newInstance();
             }
         }
     }
     return null;
 }
Пример #3
0
 static function getNamespaceRoot()
 {
     return core\ApplicationRegistry::getNamespaceRoot();
 }