article を要素として含む xml ナビゲーション システムがあります。ブレッドクラムは記事ページまで機能し、記事のリストをタイトル (リンクとして) とティーザー パラグラフと共に表示します。記事全体を表示するページには、ブレッドクラム ナビゲーションが表示されません。
私は何か間違ったことをしていることを知っていますが、私は zend に慣れていないので、どこにあるのかわかりません。
誰かが私を正しい方向に向けることができれば幸いです。
XML ナビゲーション:
<?xml version="1.0" encoding="UTF-8"?>
<configdata>
<nav>
<home>
<label>Home</label>
<controller>index</controller>
<action>index</action>
<pages>
<about>
<label>About</label>
<controller>index</controller>
<action>about</action>
</about>
<board>
<label>Executive Committee</label>
<controller>index</controller>
<action>committee</action>
</board>
<events>
<label>Events</label>
<controller>index</controller>
<action>events</action>
</events>
<member>
<label>CNFS Members</label>
<controller>index</controller>
<action>member</action>
</member>
<news>
<label>Blog</label>
<controller>blog</controller>
<action>index</action>
</news>
<contact>
<label>Contact</label>
<controller>index</controller>
<action>contact</action>
</contact>
</pages>
</home>
</nav>
</configdata>
これは、ナビゲーション用のブートストラップ ファイル内の関数です。
<?php
protected function _initViewNavigation(){
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$config = new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav');
$navigation = new Zend_Navigation($config);
$view->navigation($navigation);
}
?>
これは、ビューにブレッドクラムを表示する方法です。
<?php echo 'Your are here: ' . $this->navigation()->breadcrumbs() ->setMinDepth(0)->setLinkLast(false)->setSeparator(" / ");?>