Ejemplo n.º 1
0
 private function getCrownsList()
 {
     $sql = Db::getInstance();
     $query = "SELECT c.name, c.small_name FROM crown c";
     $data = $sql->exec($query);
     return $data;
 }
Ejemplo n.º 2
0
 * Created by PhpStorm.
 * User: calmacil
 * Date: 27/12/15
 * Time: 11:04
 */
define("ROOT", __DIR__ . '/..');
require_once ROOT . '/vendor/autoload.php';
use Got\Core\Config;
use Got\Core\Debug;
use Got\Core\Router;
use Got\Core\Response;
use Got\Core\Request;
$conf = new Config(ROOT . "/config/config.json");
if (Config::get('debug')) {
    $debug = Debug::getInstance();
    $sql = \Got\Core\Db::getInstance();
    $debug->setupPdoCollector($sql->getConnection());
}
$router = Router::getInstance(ROOT . Config::get('path')->routes_file);
$request = new Request($_SERVER['REQUEST_URI']);
$response = new Response();
try {
    $request->proceed();
    $controller_name = ucfirst($request->getController());
    $action_name = $request->getAction() . 'Action';
    $class = '\\Got\\Action\\' . $controller_name;
    $controller = new $class($request, $response);
    if (!method_exists($controller, $action_name) || !$controller->{$action_name}()) {
        header('HTTP/1.1 404 Not Found');
        echo "BOUH";
        die;