O'Reilly logo

concrete5 by Remo Laubacher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - creating package model

Carry out the following steps:

  1. In our package c5book, create a new folder named models if it doesn't already exist. Within that folder, create a new file named broken_links.php.
    <?php defined('C5_EXECUTE') or die(_("Access Denied.")); class BrokenLinks { public static function add($cID, $link, $statusCode, $statusName) { $db = Loader::db(); $values = array($cID, $link, $statusCode, $statusName); $db->Execute('INSERT INTO btLinkChecker (cID, link, linkStatusCode, linkStatusName) VALUES (?,?,?,?)', $values); } public static function deleteAll() { package modelcreating$db = Loader::db(); $db->Execute('DELETE FROM btLinkChecker'); } public static function getBrokenLinks($includeDetails=true) { $query = 'SELECT ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required