I tried to convert my CodeIgniter 3 file to pdf with this Dompdf library: https://github.com/iamfiscus/Codeigniter-DOMPDF
Got few errors but already fixed it from this github source: https://github.com/dompdf/dompdf/tree/981c1b977fbc78eeb5bc6f1e4cc3ae217b6a65d2/src/Frame
Yet there's still one error message that says like this:
A PHP Error was encountered
Severity: Compile Error
Message: Could not check compatibility between FrameList::getIterator(): FrameListIterator and IteratorAggregate::getIterator(): Traversable, because class FrameListIterator is not available
Filename: include/frame.cls.php
Line Number: 850
Backtrace:
Here's my source code in frame.cls.php within Dompdf library (line 833-854):
class FrameList implements IteratorAggregate {
/**
* @var Frame
*/
protected $_frame;
/**
* @param Frame $frame
*/
function __construct($frame)
{
$this->_frame = $frame;
}
/**
* @return FrameListIterator
*/
// code below is line 850:
function getIterator(): FrameListIterator
{
return new FrameListIterator($this->_frame);
}
}
Is there any way I can fix this without updating/changing the dompdf version? cause I'm a beginner coder, yet it's hard for me to resolve a library problem.
N.B: I'm manually put the library in my codeigniter, not using composer.
I already tried to find solution from many websites and video tutorials, but it's not working for me. So, I'm really hoping that anyone can get me a solution for the frame.cls.php file.