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 – adding a second controller method


Carry out the following steps:

  1. Open the controller again packages/c5book/controllers/dashboard/reports/broken_links.php and put the preceding code in it. It's pretty much the same, except there's a second method in it to display all links.

  2. The output, our single page, needs to handle these two modes as well. We're going to display a different text and a different link to switch between the two modes. We're using the variable mode, which is set to a different value by the two controller methods. Open packages/c5book/single_pages/dashboard/reports/broken_links.php and alter the content to match the following:

    <?php  
    defined('C5_EXECUTE') or die(_("Access Denied."));
    ?>
    <h1><span><?php echo t('Broken Links')?></span></h1>
    <div class="ccm-dashboard-inner">
    
     <?php if ($mode == 'brokenLinks'): ?>
     <p><?php echo t('The following links didn\'t return 200 or 302 OK / Found. You should check...