0
如何在类之外设置函数或者有更好的方法来实现它?类和扩展
我需要写在每个页面的顶部东西..因为写入的数据具有可变的高度,我不能用Header()
require_once 'tcpdf/tcpdf.php';
class TCPDF_ext extends TCPDF {
public function AcceptPageBreak(){
$this->AddPage();
$this->lastpage();
$this->add_top();
return false;
}
}
$pdf = new TCPDF_ext();
$pdf->add_top = function(){
// write something on the top of each page
};