Session controls starters
This commit is contained in:
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use CodeIgniter\Controller;
|
||||||
|
use CodeIgniter\HTTP\CLIRequest;
|
||||||
|
use CodeIgniter\HTTP\IncomingRequest;
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
use Config\Services;
|
||||||
|
/**
|
||||||
|
* Class BaseController
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
*
|
||||||
|
* For security be sure to declare any new methods as protected or private.
|
||||||
|
*/
|
||||||
|
abstract class BaseUsersController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Instance of the main Request object.
|
||||||
|
*
|
||||||
|
* @var CLIRequest|IncomingRequest
|
||||||
|
*/
|
||||||
|
protected $request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of helpers to be loaded automatically upon
|
||||||
|
* class instantiation. These helpers will be available
|
||||||
|
* to all other controllers that extend BaseController.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $helpers = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*/
|
||||||
|
public function initController(
|
||||||
|
RequestInterface $request,
|
||||||
|
ResponseInterface $response,
|
||||||
|
LoggerInterface $logger
|
||||||
|
) {
|
||||||
|
// Do Not Edit This Line
|
||||||
|
parent::initController($request, $response, $logger);
|
||||||
|
|
||||||
|
// Preload any models, libraries, etc, here.
|
||||||
|
|
||||||
|
// E.g.: $this->session = \Config\Services::session();
|
||||||
|
$this->session = \Config\Services::session();
|
||||||
|
//var_dump($this->session->bko_session);
|
||||||
|
if (
|
||||||
|
isset($this->session->bko_session) &&
|
||||||
|
$this->session->bko_session != ''
|
||||||
|
) {
|
||||||
|
// we are all good
|
||||||
|
} else {
|
||||||
|
// we need to get out
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
class Dash extends BaseController
|
class Dash extends BaseUsersController
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -312,11 +312,6 @@
|
|||||||
<span class="text-gray-400 mt-1 fw-bold fs-6">8k social visitors</span>
|
<span class="text-gray-400 mt-1 fw-bold fs-6">8k social visitors</span>
|
||||||
</h3>
|
</h3>
|
||||||
<!--end::Title-->
|
<!--end::Title-->
|
||||||
<!--begin::Toolbar-->
|
|
||||||
<div class="card-toolbar">
|
|
||||||
<a href="#" class="btn btn-sm btn-light">View All</a>
|
|
||||||
</div>
|
|
||||||
<!--end::Toolbar-->
|
|
||||||
</div>
|
</div>
|
||||||
<!--end::Header-->
|
<!--end::Header-->
|
||||||
<!--begin::Body-->
|
<!--begin::Body-->
|
||||||
|
|||||||
Reference in New Issue
Block a user