「関数リファレンス/BcBaser crumbs」の版間の差分
提供: baserCMS公式ガイド
行9: | 行9: | ||
適切なパンくずリストを出力するには、あらかじめ pre $this->BcBaser->addCrumb() pre 関数で、パンくずの要素を追加しておく必要があります。 | 適切なパンくずリストを出力するには、あらかじめ pre $this->BcBaser->addCrumb() pre 関数で、パンくずの要素を追加しておく必要があります。 | ||
− | ## | + | ## パラメータ |
− | < | + | $path |
+ | |||
+ | $options | ||
+ | |||
+ | ## 戻り値 | ||
+ | |||
+ | ## 用例 | ||
+ | ### 基本 | ||
+ | ####コード | ||
+ | <syntaxhighlight lang="php"> | ||
<?php $this->BcBaser->addCrumb('会社案内','/company/index.html') ?> | <?php $this->BcBaser->addCrumb('会社案内','/company/index.html') ?> | ||
<?php $this->BcBaser->addCrumb('沿革') ?> | <?php $this->BcBaser->addCrumb('沿革') ?> | ||
<?php $this->BcBaser->crumbs('>' , 'ホーム') ?> | <?php $this->BcBaser->crumbs('>' , 'ホーム') ?> | ||
− | </ | + | </syntaxhighlight> |
− | ## | + | ####出力 |
+ | <syntaxhighlight lang="html5"> | ||
+ | |||
+ | </syntaxhighlight> | ||
+ | |||
+ | ### 応用 | ||
+ | ####コード | ||
+ | <syntaxhighlight lang="php"> | ||
+ | <?php $this->BcBaser->getImg("/common/img/logo.png", array('alt'=>'この画像の代替テキストです', 'class'=>'testImg', 'width'=>'200px', 'height'=>'160px') ); ?> | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ####出力 | ||
+ | <syntaxhighlight lang="html5"> | ||
ホーム > 会社案内 > 沿革 | ホーム > 会社案内 > 沿革 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ## 注 | ||
+ | |||
+ | ## 変更履歴 | ||
+ | |||
+ | ## ソースファイル | ||
+ | |||
+ | ## 関連資料 |
2014年11月1日 (土) 23:18時点における版
目次
説明
この関数は、ナビゲーションとしてよく利用されている「パンくずリスト」を出力する関数です。
テンプレート等で記述することで、baserCMSの規約に沿ったパンくずリストを出力してくれます。
使い方
$this->BcBaser->crumbs( [$separator] , [$startText] )
適切なパンくずリストを出力するには、あらかじめ pre $this->BcBaser->addCrumb() pre 関数で、パンくずの要素を追加しておく必要があります。
パラメータ
$path
$options
戻り値
用例
基本
コード
<?php $this->BcBaser->addCrumb('会社案内','/company/index.html') ?> <?php $this->BcBaser->addCrumb('沿革') ?> <?php $this->BcBaser->crumbs('>' , 'ホーム') ?>
出力
応用
コード
<?php $this->BcBaser->getImg("/common/img/logo.png", array('alt'=>'この画像の代替テキストです', 'class'=>'testImg', 'width'=>'200px', 'height'=>'160px') ); ?>
出力
ホーム > 会社案内 > 沿革