Exemplo n.º 1
0
 /**
  * View For Plugin
  */
 public static function import($_plg, $_value_, $_data_ = null)
 {
     if (!is_null($_data_)) {
         foreach ($_data_ as $_key_ => $_value2_) {
             ${$_key_} = $_value2_;
         }
     }
     //getFile
     $_name_ = str_replace('.', '/', $_value_);
     //
     $_link1_ = Plugins::getPath($_plg) . Plugins::getCore($_plg, "views") . '/' . $_name_ . '.php';
     $_link2_ = Plugins::getPath($_plg) . Plugins::getCore($_plg, "views") . '/' . $_name_ . '.tpl.php';
     //die($_link1_);
     //
     $_tpl_ = false;
     //
     if (file_exists($_link1_)) {
         $_link3_ = $_link1_;
         $_tpl_ = false;
     } else {
         if (file_exists($_link2_)) {
             $_link3_ = $_link2_;
             $_tpl_ = true;
         } else {
             throw new ViewNotFoundException($_name_);
         }
     }
     if ($_tpl_) {
         self::$showed = "tpl";
         Template::show($_link3_, $_data_);
     } else {
         self::$showed = "smpl";
         \Connector::need($_link3_);
     }
 }
Exemplo n.º 2
0
 /**
  * Init Framework classes
  */
 protected static function ini()
 {
     Alias::ini(self::$root);
     Sys::ini();
     Url::ini();
     Path::ini();
     Template::run();
     Faker::ini();
     Links::ini();
     Errors::ini(self::$root);
     License::ini(self::$page);
     //langues
     Lang::setReplaceBlankTranslationBy(Lang::REPLACE_BY_BLANK);
     Lang::setReplaceNonExistingTranslationBy(Lang::REPLACE_BY_KEY_TRANSLATE_ME);
     Lang::initLanguage();
     Database::ini();
     Auth::ini();
     Plugins::ini();
     Widgets::ini();
 }