Tutorials introduce format objects step by step. Recipes combine these objects to build concrete presentations. Each recipe keeps layout calculations in its script and explains the choices producing the result.
| Recipe | Result | Code |
|---|---|---|
| An explicitly drawn table | Header, five rows, alternating backgrounds, grid and total. | table.php |
Propose a recipe
A contribution can demonstrate a printed table of contents, chart, information sheet or another composition. Choose a case small enough for readers to follow the object graph and its operators.
- Add a standalone script in the core's
examples/, with reproducible demonstration data and an optional output path. - Comment the steps explaining objects, resources, references and coordinates. The script loads
vendor/autoload.phpand uses the checkout's API. - Add a guide in the documentation repository's
docs/recipes/, with a command, a preview derived from the PDF, parameters to try and composition limitations. Credit the author and sources if the recipe comes from a contribution or existing work. - Add links to this index, inspect the PDF in a reader and run
composer checkin the core checkout. PHPStan also analyzes examples; CI runs everyexamples/*.phpscript and checks its PDF with qpdf. After publishing the package, update the source manifest and validate the central site build.
Recipes can demonstrate position calculations and repetition in PHP. The PDF values, resources and instructions they produce remain model objects. A reusable layout API can be developed in a separate library.