Some blocks depend on
helpers, files, and libraries, which aren't in the block directory. The PDF generator block is such an example. It depends on a file found in the tools
directory in the root of your concrete5 website as well as a file in the libraries
directory. How do we include such a directory in a package? Here are the steps that you need to follow:
Move the
pdf
directory fromblocks
topackages/c5book/blocks
since we also want to include the block in the package.Locate the
c5book
directory withinpackages
and create a new subdirectory namedtools
.Move
generate_pdf.php
fromtools
topackages/c5book/tools
.Create another directory named
libraries
inpackages/c5book
.Move the
MPDF56
directory fromlibraries
topackages/c5book/libraries
.As we've moved two objects, we have to make sure our code looks for them in the right place. Open
packages/c5book/tools/generate.php
and look forLoader::library
at the beginning of the file. We have...