I generated a simple MyReport empt class as follows
<?php
//MyReport.php
require_once APPPATH."Libraries/koolreport/core/autoload.php";
class MyReport extends \koolreport\KoolReport
{
function settings()
{
}
function setup()
{
}
}
I call the following method from the controller
<?php namespace App\Controllers;
require APPPATH."Reports/MyReport.php";
class Report extends BaseController
{
var $attributes;
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
// Do Not Edit This Line
parent::initController($request, $response, $logger);
// Creating new configuration object by hand
$this->config = new \Config\Tts();
$this->attributes = $this->config->report;
}
public function index()
{
$report = new MyReport;
$report->run()->render();
}
}
The report is located in Reports folder (with capital R). I checked if it the right path on the server and it shows a correct path /var/www/osefer.com/public_html/dev/app/Reports/MyReport.php
Still I have the same error:
CRITICAL - 2020-10-14 13:34:32 --> Class 'App\Controllers\MyReport' not found
why it is looking the class in App\Controllers\MyReport. I already included in using the require command:
require APPPATH."Reports/MyReport.php";