コード例 #1
0
ファイル: Include_.php プロジェクト: electro-modules/matisse
 protected function createView()
 {
     $prop = $this->props;
     $ctx = $this->context;
     $controller = $prop->class;
     // Resolve controller for the view (if applicable).
     if (!exists($controller) && exists($prop->view)) {
         $controller = $ctx->findControllerForView($prop->view);
     }
     if (exists($prop->template)) {
         if (exists($controller)) {
             $subComponent = $this->makeShadowController($controller, $prop);
             $subComponent->template = $prop->template;
             $this->setShadowDOM($subComponent);
         } else {
             $this->template = $prop->template;
         }
     } elseif (exists($prop->view)) {
         if (exists($controller)) {
             $subComponent = $this->makeShadowController($controller, $prop);
             $subComponent->templateUrl = $prop->view;
             $this->setShadowDOM($subComponent);
         } else {
             $this->templateUrl = $prop->view;
         }
     } else {
         if (exists($prop->file)) {
             $fileContent = loadFile($prop->file);
             if ($fileContent === false) {
                 throw new FileIOException($prop->file, 'read', explode(PATH_SEPARATOR, get_include_path()));
             }
             echo $fileContent;
             return;
         } else {
             if ($prop->styles) {
                 $ctx->getAssetsService()->outputStyles();
                 return;
             } else {
                 if ($prop->scripts) {
                     $ctx->getAssetsService()->outputScripts();
                     return;
                 }
             }
         }
     }
     parent::createView();
 }