Answer the question
In order to leave comments, you need to log in
And how can this be?
Hello!
once
<?php
namespace app\controllers;
use vendor\core\base\Controller;
class AppController extends Controller
{
protected static $site = [];
public function __construct($route)
{
parent::__construct($route);
self::$site['generator'] = 'ВОЙНУШКА';
self::$site['all_users'] = self::decline(self::pdo('select * from users')->rowCount(), [
'воин',
'воина',
'воинов'
]);
self::$site['page_generation'] = round(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], 3) . ' сек, ';
self::$site['server_time'] = date('H:i:s');
self::$site['online'] = self::pdo('select * from users where online > ?', [
time()
])->rowCount();
self::$site['description'] = 'Военная экономическая стратегия';
$site = self::$site;
self::set(compact('site'));
}
}
<?php
namespace vendor\core\base;
abstract class Controller extends Model
{
public $route = [];
public $vars = [];
public function __construct($route)
{
$this->route = $route;
}
public function set($vars)
{
$this->vars = $vars;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question