PHP Classes

File: documentor/documentation.php

Recommend this page to a friend!
  Classes of Mark Rolich   PHP URL Router Class   documentor/documentation.php   Download  
File: documentor/documentation.php
Role: Auxiliary script
Content type: text/plain
Description: Documention generator files
Class: PHP URL Router Class
Match URLs with routes for controllers and actions
Author: By
Last change: Update of documentor/documentation.php
Date: 4 months ago
Size: 727 bytes
 

Contents

Class file image Download
<?php
include '../src/Bike/Router.php';

function
codeFile($filename) {
    return
'<div class="code-block"><div class="code">' . highlight_file($filename, true) . '</div></div>';
}

function
codeString($code) {
   
$result = var_export($code, true);
   
$result = str_replace(array(
           
'array (',
           
"=> \n ",
           
",\n )",
           
"),\n)"
       
), array(
           
'array(',
           
'=> ',
           
"\n )",
           
")\n)"
       
),
       
$result);

   
$result = stripcslashes($result);
   
$result = htmlspecialchars_decode($result);

    return
'<div class="code-block"><div class="code">' . highlight_string("<?php \r\n" . $result . ";\r\n?>", true) . '</div></div>';
}
?>