Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – creating the PDF generation block


Carry out the following steps:

  1. Create a new folder in blocks named pdf. In this folder, create the db.xml file like we did before:

    <?xml version="1.0"?>
    <schema version="0.3">
       <table name="btPdf">
          <field name="bID" type="I">
             <key />
             <unsigned />
          </field>      
       </table>
    </schema>
  2. Create add.php and edit.php again; the content is again the same:

    <?php 
    defined('C5_EXECUTE') or die(_("Access Denied."));
    $this->inc('form_setup_html.php'); 
    ?>
  3. The forth file form_setup_html.php doesn't have any options in this case; it's even simpler than before:

    <?php
    defined('C5_EXECUTE') or die(_("Access Denied."));
    ?>
    No options here!
  4. As easy is controller.php, with just the mandatory things in it—no logic or anything else:

    <?php 
    defined('C5_EXECUTE') or die(_("Access Denied."));
    class PdfBlockController extends BlockController {
       
       protected $btTable...