コード例 #1
0
function perch_pages_breadcrumbs($opts = array(), $return = false)
{
    $Pages = new PerchContent_Pages();
    $Perch = Perch::fetch();
    $default_opts = array('hide-extensions' => false, 'hide-default-doc' => true, 'template' => 'breadcrumbs.html', 'skip-template' => false, 'add-trailing-slash' => false, 'navgroup' => false, 'include-hidden' => false, 'use-attributes' => true);
    if (is_array($opts)) {
        $opts = array_merge($default_opts, $opts);
    } else {
        $opts = $default_opts;
    }
    if ($opts['skip-template']) {
        $return = true;
    }
    $current_page = $Perch->get_page();
    $opts['from-path'] = $current_page;
    $r = $Pages->get_breadcrumbs($opts);
    if ($return) {
        return $r;
    }
    echo $r;
    PerchUtil::flush_output();
}