「関数リファレンス/BcBaser getTitle」の版間の差分
提供: baserCMS公式ガイド
行16: | 行16: | ||
(string)$categoriTitleOn | (string)$categoriTitleOn | ||
: カテゴリタイトルを表示するかどうか boolean で指定する | : カテゴリタイトルを表示するかどうか boolean で指定する | ||
− | : | + | : 初期値:null |
## 戻り値 | ## 戻り値 |
2015年4月26日 (日) 21:56時点における版
目次
説明
タイトルタグを取得する。
ページタイトルと直属のカテゴリ名が同じ場合は、ページ名を省略します。
使い方
$this->BcBaser->getTitle( [$separator] , [$categoriTitleOn] )
パラメータ
- (string)$separator
- コンテンツタイトルとページタイトルの間のセパレーターを指定する
- 初期値は'|'(縦棒)
- (string)$categoriTitleOn
- カテゴリタイトルを表示するかどうか boolean で指定する
- 初期値:null
戻り値
- (string)
- コンテンツタイトル 【セパレータ】 カテゴリ 【セパレータ】 ページタイトル
用例
基本
コード
<?php $this->BcBaser->getTitle(); ?>
取得
コンテンツタイトル | (カテゴリ)| ページタイトル
応用
コード
<?php $this->BcBaser->getTitle('/', false); ?>
取得
コンテンツタイトル / ページタイトル
(カテゴリーが出力されない)