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 – list all available functions


As with most classes, you often have to call a method to get a value and not directly access a property as the method might do some additional checks you'd lose if you accessed the property directly.

  1. To get a list of all available methods without looking into the code, just add the following code where you'd like to get more information. Let's put it in default.php again like we did with the constants:

    <?php
    $b = new Area('Main');
    $b->display($c);
    
    echo '<xmp>';
    $reflection = new ReflectionClass($this); 
    print_r($reflection->getMethods()); 
    echo '</xmp>';
    ?>
  2. This will print a long list where you can find all the available methods next to the property named name:

    Array
    (
        [0] =>ReflectionMethod Object
            (
                [name] =>getInstance
                [class] => View
            )
    
        [1] =>ReflectionMethod Object
            (
                [name] =>getThemeFromPath
                [class] => View
            )

What...