25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4KB

  1. <?php
  2. namespace App\Controllers;
  3. use CodeIgniter\Controller;
  4. use CodeIgniter\HTTP\CLIRequest;
  5. use CodeIgniter\HTTP\IncomingRequest;
  6. use CodeIgniter\HTTP\RequestInterface;
  7. use CodeIgniter\HTTP\ResponseInterface;
  8. use Psr\Log\LoggerInterface;
  9. /**
  10. * Class BaseController
  11. *
  12. * BaseController provides a convenient place for loading components
  13. * and performing functions that are needed by all your controllers.
  14. * Extend this class in any new controllers:
  15. * class Home extends BaseController
  16. *
  17. * For security be sure to declare any new methods as protected or private.
  18. */
  19. abstract class BaseController extends Controller
  20. {
  21. /**
  22. * Instance of the main Request object.
  23. *
  24. * @var CLIRequest|IncomingRequest
  25. */
  26. protected $request;
  27. /**
  28. * An array of helpers to be loaded automatically upon
  29. * class instantiation. These helpers will be available
  30. * to all other controllers that extend BaseController.
  31. *
  32. * @var array
  33. */
  34. protected $helpers = ['auth', 'session'];
  35. /**
  36. * Constructor.
  37. */
  38. public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
  39. {
  40. // Do Not Edit This Line
  41. parent::initController($request, $response, $logger);
  42. // Preload any models, libraries, etc, here.
  43. // E.g.: $this->session = \Config\Services::session();
  44. }
  45. }