Carry out the following steps:
In our package
c5book
, create a new directory structurecontrollers/dashboard/reports
.Within the new directory, create a file named
broken_links.php
and put the following content in it to fetch the data, and pass it on to the single page by using$this->set
:<?php defined('C5_EXECUTE') or die(_("Access Denied.")); class DashboardReportsBrokenLinksController extends Controller { public $helpers = array('form', 'html'); public function view() { $db = Loader::db(); $brokenLinks = array(); $result = $db->Execute('SELECT * FROM btLinkChecker WHERE linkStatusCode NOT IN (200,302) OR linkStatusCode IS NULL'); while ($row = $result->FetchRow()) { $row['page'] = Page::getByID($row['cID']); $row['status'] = $row['linkStatusCode'] . ' ' . $row['linkStatusName']; if (trim($row['status']) == '') $row['status'] = 'Server not found';...