Cradle  0.3.3
Simple library for creating Web-based applications
FileNavigation Class Reference

File Navigation. More...

Public Member Functions

 __construct ($arrayParams=null)
 
 getCurrentItem ()
 
 getNavigation ()
 

Data Fields

 $routerPrefix = 'r'
 
 $cssActive = 'active'
 
 $listType = 'ul'
 
 $path = ""
 
 $filePatterns = null
 
 $excludePatterns = null
 
 $recursive = true
 
 $stripExtention = '.php'
 

Detailed Description

File Navigation.

Simple file navigation. Creates HTML tree list from file system tree.

Version
1.0
Author
Digger mrdig.nosp@m.ger@.nosp@m.sad-s.nosp@m.yste.nosp@m.ms.ru

Example of usage:

<?php
//--- file: index.php
$navigation = new FileNavigation(['filePatterns' => '.*\.php$', 'excludePatterns' => '^' . basename(__FILE__) . '$']);
$navigationMenu = $navigation->getNavigation();
$contentFile = $navigation->getCurrentItem();
?>
<html>
<body>
<nav> <?= $navigationMenu => </nav>
<div class="content"> <?php include $contentFile; ?> </div>
</body>
</html>

Constructor & Destructor Documentation

__construct (   $arrayParams = null)

Constructor

Parameters
array$arrayParamsInitialization parameters of the class.

Example:

$navigation = new FileNavigation(['filePatterns' => '.*\.php$', 'excludePatterns' => '^' . basename(__FILE__) . '$']);

Member Function Documentation

getCurrentItem ( )

Returns current active item

Returns
string Current active item
getNavigation ( )

Returns HTML code list contains tree of files spesified by class properties.

Returns
string HTML code

The documentation for this class was generated from the following file: