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. How do we include such a file in a package?
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
mpdf50
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 to add a second parameterto Loader::library
, as shown here:<?php defined('C5_EXECUTE') or die(_...