Fixes for load libraries using php autoload
This commit is contained in:
parent
0b21909a78
commit
47c7003e3b
4 changed files with 82 additions and 9 deletions
38
modules/admin/libraries/tplcontroller.php
Normal file
38
modules/admin/libraries/tplcontroller.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
use PhangoApp\WPDO;
|
||||
use PhaTemplates\Templates;
|
||||
|
||||
class TplController {
|
||||
|
||||
public $tpl;
|
||||
public $db;
|
||||
|
||||
public function __construct() {
|
||||
|
||||
session_start();
|
||||
|
||||
$table=new WPDO\WTable('useradmin', ['username', 'password', 'email']);
|
||||
|
||||
$this->db=new WPDO\WPDO($table);
|
||||
|
||||
$this->tpl=new Templates(['theme/admin/templates', 'modules/admin/templates']);
|
||||
|
||||
}
|
||||
|
||||
public function check_login() {
|
||||
|
||||
if(isset($_SESSION['admin_login'])) {
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue