「関数リファレンス/BcBaser crumbs」の版間の差分
提供: baserCMS公式ガイド
行1: | 行1: | ||
##説明 | ##説明 | ||
+ | この関数は、ナビゲーションとしてよく利用されている「パンくずリスト」を出力する関数です。 | ||
+ | テンプレート等で記述することで、baserCMSの規約に沿ったパンくずリストを出力してくれます。 | ||
+ | |||
+ | ##使い方 | ||
$this->BcBaser->crumbs( [$separator] , [$startText] ) | $this->BcBaser->crumbs( [$separator] , [$startText] ) | ||
+ | 適切なパンくずリストを出力するには、あらかじめ pre $this->BcBaser->addCrumb() pre 関数で、パンくずの要素を追加しておく必要があります。 | ||
− | + | ##例 | |
+ | <pre> | ||
+ | <?php $this->BcBaser->addCrumb('会社案内','/company/index.html') ?> | ||
+ | <?php $this->BcBaser->addCrumb('沿革') ?> | ||
+ | <?php $this->BcBaser->crumbs('>' , 'ホーム') ?> | ||
+ | </pre> | ||
+ | |||
+ | ##出力結果 | ||
+ | ホーム > 会社案内 > 沿革 |
2014年11月1日 (土) 22:46時点における版
説明
この関数は、ナビゲーションとしてよく利用されている「パンくずリスト」を出力する関数です。
テンプレート等で記述することで、baserCMSの規約に沿ったパンくずリストを出力してくれます。
使い方
$this->BcBaser->crumbs( [$separator] , [$startText] ) 適切なパンくずリストを出力するには、あらかじめ pre $this->BcBaser->addCrumb() pre 関数で、パンくずの要素を追加しておく必要があります。
例
<?php $this->BcBaser->addCrumb('会社案内','/company/index.html') ?> <?php $this->BcBaser->addCrumb('沿革') ?> <?php $this->BcBaser->crumbs('>' , 'ホーム') ?>
出力結果
ホーム > 会社案内 > 沿革