/** * Translation object * @var $translation */ public function __construct() { $this->app = new Slim(['path' => __DIR__, 'view' => new Smarty(), "database.default" => Config::get('db.default'), "database.connections" => Config::get('db.connections')]); $this->view = $this->app->view(); $this->view->parserDirectory = Config::basePath('vendor') . '/smarty'; $this->view->parserExtensions = Config::basePath('vendor') . '/slim/views/SmartyPlugins'; $this->view->parserCompileDirectory = Config::basePath('http') . '/cache/smarty/compile'; $this->view->parserCacheDirectory = Config::basePath('http') . '/cache/smarty/cache'; $viewInstance = $this->app->view()->getInstance(); if ($this->app->config('mode') == 'development') { $viewInstance->force_compile = true; $viewInstance->force_cache = false; } else { $viewInstance->force_compile = false; $viewInstance->force_cache = true; } $this->routers = $this->app->router(); Register::$app = $this->app; $this->Register($this->app); }
<?php require 'vendor/autoload.php'; require_once \App\Concept\Config::basePath('src') . '/app.php';
/** * Set tpl directory */ private function setTplDirectory() { $this->tplDirectory = Config::basePath('http/web/tpl/'); }
/** * set raw script or styles * @param null $content */ public static function raw($content = null) { if (!is_null($content)) { /** * get fullpath */ $fullPath = Config::basePath('http/web/tpl/raw/'); $fullPath .= str_replace('::', '/', $content); $fullPath .= '.tpl'; /** * fetch template */ self::$raw[] = \View::fetch($fullPath); } }
<?php use App\Concept\ConceptApp; use App\Concept\Config; $conceptApp = ConceptApp::boot()->app(); require_once Config::basePath('src') . '/routes.php'; App::run();