2020-05-27 18:46:16 +02:00
|
|
|
<?php
|
2020-06-10 15:00:12 +00:00
|
|
|
|
2021-06-08 09:52:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-04-02 17:20:02 +00:00
|
|
|
namespace App\Controllers;
|
|
|
|
|
|
|
|
use CodeIgniter\Controller;
|
2023-06-13 16:05:02 +00:00
|
|
|
use CodeIgniter\HTTP\IncomingRequest;
|
2021-04-02 17:20:02 +00:00
|
|
|
use CodeIgniter\HTTP\RequestInterface;
|
2023-07-06 15:56:05 +00:00
|
|
|
use CodeIgniter\HTTP\Response;
|
2021-04-02 17:20:02 +00:00
|
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
|
|
use Psr\Log\LoggerInterface;
|
2021-09-02 16:34:25 +00:00
|
|
|
use ViewThemes\Theme;
|
2021-04-02 17:20:02 +00:00
|
|
|
|
2020-05-27 18:46:16 +02:00
|
|
|
/**
|
|
|
|
* Class BaseController
|
|
|
|
*
|
2021-05-19 16:35:13 +00:00
|
|
|
* BaseController provides a convenient place for loading components and performing functions that are needed by all
|
|
|
|
* your controllers. Extend this class in any new controllers: class Home extends BaseController
|
2020-05-27 18:46:16 +02:00
|
|
|
*
|
|
|
|
* For security be sure to declare any new methods as protected or private.
|
|
|
|
*/
|
2022-06-13 16:30:34 +00:00
|
|
|
abstract class BaseController extends Controller
|
2020-05-27 18:46:16 +02:00
|
|
|
{
|
2023-06-13 16:05:02 +00:00
|
|
|
/**
|
|
|
|
* Instance of the main Request object.
|
|
|
|
*
|
|
|
|
* @var IncomingRequest
|
|
|
|
*/
|
|
|
|
protected $request;
|
|
|
|
|
2023-07-06 15:56:05 +00:00
|
|
|
/**
|
|
|
|
* Instance of the main response object.
|
|
|
|
*
|
|
|
|
* @var Response
|
|
|
|
*/
|
|
|
|
protected $response;
|
|
|
|
|
2023-07-04 16:09:14 +00:00
|
|
|
/**
|
|
|
|
* An array of helpers to be loaded automatically upon
|
|
|
|
* class instantiation. These helpers will be available
|
|
|
|
* to all other controllers that extend BaseController.
|
|
|
|
*
|
|
|
|
* @var string[]
|
|
|
|
*/
|
|
|
|
protected $helpers = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Be sure to declare properties for any property fetch you initialized.
|
|
|
|
* The creation of dynamic property is deprecated in PHP 8.2.
|
|
|
|
*/
|
|
|
|
// protected $session;
|
|
|
|
|
2020-06-10 15:00:12 +00:00
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*/
|
|
|
|
public function initController(
|
2021-04-02 17:20:02 +00:00
|
|
|
RequestInterface $request,
|
|
|
|
ResponseInterface $response,
|
|
|
|
LoggerInterface $logger
|
2021-05-06 14:00:48 +00:00
|
|
|
): void {
|
2023-11-29 16:33:18 +00:00
|
|
|
$this->helpers = [...$this->helpers, 'svg', 'components', 'misc', 'seo', 'premium_podcasts'];
|
2021-09-02 16:34:25 +00:00
|
|
|
|
2020-06-10 15:00:12 +00:00
|
|
|
// Do Not Edit This Line
|
|
|
|
parent::initController($request, $response, $logger);
|
2021-09-02 16:34:25 +00:00
|
|
|
|
|
|
|
Theme::setTheme('app');
|
2020-06-10 15:00:12 +00:00
|
|
|
}
|
2020-05-27 18:46:16 +02:00
|
|
|
}
|