個人用ツール

「関数リファレンス/BcBaser getTitle」の版間の差分

提供: baserCMS公式ガイド

移動: 案内, 検索
行39: 行39:
 
####コード
 
####コード
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
<?php echo $this->BcBaser->getTitle('/', false); ?>
+
<?php $this->BcBaser->getTitle('/', false); ?>
 
</syntaxhighlight>
 
</syntaxhighlight>
  

2014年11月7日 (金) 18:30時点における版

説明

タイトルタグを取得する。
metaタグ用のタイトルを返す。

ページタイトルと直属のカテゴリ名が同じ場合は、ページ名を省略します。

使い方

$this->BcBaser->getTitle( [$separator] , [$categoriTitleOn] )

パラメータ

$separator
コンテンツタイトルとページタイトルの間のセパレーターを指定する
初期値は'|'(縦棒)
$categoriTitleOn
カテゴリタイトルの出力の有無を指定する
初期値:true
booleanで指定

戻り値

(string)
コンテンツタイトル 【セパレータ】 カテゴリ 【セパレータ】 ページタイトル

用例

基本

コード

<?php $this->BcBaser->getTitle();  ?>

取得

コンテンツタイトル  | (カテゴリ)| ページタイトル

応用

コード

<?php $this->BcBaser->getTitle('/', false); ?>

取得

コンテンツタイトル  / ページタイトル

(カテゴリーが出力されない)

変更履歴

ソースファイル

関連資料

類似の関数

getImg