2020-07-10 12:20:25 +00:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 09:52:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-08-23 11:05:16 +00:00
|
|
|
namespace Modules\Admin\Controllers;
|
2020-07-10 12:20:25 +00:00
|
|
|
|
2024-12-17 15:06:08 +00:00
|
|
|
use App\Libraries\HtmlHead;
|
2021-04-02 17:20:02 +00:00
|
|
|
use CodeIgniter\Controller;
|
2023-06-21 16:17:11 +00:00
|
|
|
use CodeIgniter\HTTP\IncomingRequest;
|
2021-04-02 17:20:02 +00:00
|
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
2024-05-29 10:24:13 +00:00
|
|
|
use Override;
|
2021-04-02 17:20:02 +00:00
|
|
|
use Psr\Log\LoggerInterface;
|
2021-09-02 16:34:25 +00:00
|
|
|
use ViewThemes\Theme;
|
2021-04-02 17:20:02 +00:00
|
|
|
|
2020-07-10 12:20:25 +00:00
|
|
|
/**
|
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-07-10 12:20:25 +00: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-07-10 12:20:25 +00:00
|
|
|
{
|
2023-06-21 16:17:11 +00:00
|
|
|
/**
|
|
|
|
* Instance of the main Request object.
|
|
|
|
*
|
|
|
|
* @var IncomingRequest
|
|
|
|
*/
|
|
|
|
protected $request;
|
|
|
|
|
2024-05-29 10:24:13 +00:00
|
|
|
#[Override]
|
2020-07-10 12:20:25 +00:00
|
|
|
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-15 16:17:43 +00:00
|
|
|
$this->helpers = [...$this->helpers, 'auth', 'breadcrumb', 'svg', 'components', 'misc'];
|
2021-09-02 16:34:25 +00:00
|
|
|
|
2020-07-10 12:20:25 +00:00
|
|
|
// Do Not Edit This Line
|
|
|
|
parent::initController($request, $response, $logger);
|
2021-09-02 16:34:25 +00:00
|
|
|
|
|
|
|
Theme::setTheme('admin');
|
2020-07-10 12:20:25 +00:00
|
|
|
}
|
2024-12-17 15:06:08 +00:00
|
|
|
|
|
|
|
protected function setHtmlHead(string $title): void
|
|
|
|
{
|
|
|
|
/** @var HtmlHead $head */
|
|
|
|
$head = service('html_head');
|
|
|
|
|
|
|
|
$head
|
|
|
|
->title($title . ' | Castopod Admin')
|
|
|
|
->description(
|
|
|
|
'Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience.'
|
|
|
|
);
|
|
|
|
}
|
2020-07-10 12:20:25 +00:00
|
|
|
}
|