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 – getting a list of available constants


Carry out the following steps to get a list of available constants:

  1. Open default.php from your theme in a text editor.

  2. Look for the following PHP block:

    <?php
    $b = new Area('Main');
    $b->display($c);
    ?>
  3. Before the closing PHP tags ?>, insert a few more lines so it looks like the following:

    <?php
    $b = new Area('Main');
    $b->display($c);
    echo '<xmp>';
    print_r(get_defined_constants(true));
    echo '</xmp>';
    ?>
  4. Open a page of a type without a page template. Remember, we've created a template for the left- and right-sidebars. Pick full width for example, otherwise the inserted code won't be executed.

  5. The output will contain a huge list of constants categorized by modules. At the end there's a category named user; these are the constants which are not coming from PHP itself but rather from concrete5. Look at them and you'll find a lot of constants related to directories and URLs. They might be useful one day.

What just...