Skip to content

Instantly share code, notes, and snippets.

@jbroadway
Created August 27, 2013 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbroadway/6357687 to your computer and use it in GitHub Desktop.
Save jbroadway/6357687 to your computer and use it in GitHub Desktop.
Custom tree structures in Elefant.
; <?php /* apps/myapp/conf/config.php
[Paths]
navigation_json = conf/myapp_navigation.json
; */ ?>
<?php // apps/myapp/handlers/menu.php
$n = new MyNav;
// use $n just like the Navigation class
?>
<?php // apps/myapp/lib/MyNav.php
class MyNav extends Tree {
public function __construct ($file = null) {
$file = $file ? $file : Appconf::get ('myapp', 'Paths', 'navigation_json');
parent::__construct ($file);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment