Skip to content

Commit

Permalink
Improve setCallbacks doc
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Sweeney <brian@eclecticgeek.com>
  • Loading branch information
Mellthas and bsweeney committed Nov 16, 2021
1 parent ba84cb6 commit aa594c1
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Dompdf.php
Expand Up @@ -1420,12 +1420,20 @@ public function set_callbacks($callbacks)

/**
* Sets callbacks for events like rendering of pages and elements.
* The callbacks array contains arrays with 'event' set to 'begin_page',
* 'end_page', 'begin_frame', or 'end_frame' and 'f' set to a function or
* object plus method to be called.
*
* The function 'f' must take an array as argument, which contains info
* about the event.
* The callbacks array should contain arrays with `event` set to a callback
* event name and `f` set to a function or object plus method to be called.
*
* The available callback events are:
* * `begin_page_reflow`: called before page reflow
* * `begin_frame`: called before a frame is rendered
* * `end_frame`: called after frame rendering is complete
* * `begin_page_render`: called before a page is rendered
* * `end_page_render`: called after page rendering is complete
*
* The function `f` must take an array as argument, which contains info
* about the event (`[0 => Canvas, 1 => Frame, "canvas" => Canvas,
* "frame" => Frame]`).
*
* @param array $callbacks the set of callbacks to set
*/
Expand Down

0 comments on commit aa594c1

Please sign in to comment.