Esempio n. 1
0
 /**
  * for singleton design pattern on View object
  * also there is some flexibility over changing views direction
  * with passing your custom direction to self::make as third parameter
  *
  * @param null $baseDir
  * @return null
  */
 public static function getInstance($baseDir = null)
 {
     if (self::$view == null) {
         $finder = new \Wp\View\Finder();
         if ($baseDir) {
             $finder->viewsDirection = $baseDir;
         }
         self::$view = new View($finder);
         self::$view->bladeCache = \App\Config\Config::bladeCache();
     } else {
         return self::$view;
     }
 }