/** * Sets the request, route, database, view and response variables. */ public function __construct() { $this->route = Router::currentRoute(); // Set database connection $this->db = ConnectionManager::connection(); }
/** * Connects to the configured database. */ protected function connectDatabase() { if (!$this->databaseConfig) { return null; } $this->databaseConnection = ConnectionManager::create($this->databaseConfig); }