You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ss-panel-v3-mod_Uim2/app/Controllers/BaseController.php

53 lines
783 B
PHTML

9 years ago
<?php
namespace App\Controllers;
8 years ago
use App\Models\User;
9 years ago
use App\Services\View;
use App\Services\Auth;
8 years ago
use Smarty;
9 years ago
/**
* BaseController
*/
class BaseController
{
/**
8 years ago
* @var Smarty
*/
protected $view;
9 years ago
/**
8 years ago
* @var User
*/
protected $user;
9 years ago
/**
* Construct page renderer
*/
public function __construct()
9 years ago
{
$this->view = View::getSmarty();
$this->user = Auth::getUser();
9 years ago
}
/**
* Get smarty
*
8 years ago
* @return Smarty
*/
public function view()
{
return $this->view;
}
9 years ago
/**
* @param $response
* @param $res
* @return mixed
*/
public function echoJson($response, $res)
{
return $response->getBody()->write(json_encode($res));
}
}