「関数リファレンス/BcBaser getContentsTitle」の版間の差分
提供: baserCMS公式ガイド
Tomohiro Abe (トーク | 投稿記録) |
|||
(3人の利用者による、間の7版が非表示) | |||
行1: | 行1: | ||
## 説明 | ## 説明 | ||
− | $this->BcBaser->getTitle()では、サイト名やカテゴリ名等を含んだタイトルを取得できますが、$this->BcBaser->getContentsTitle() | + | $this->BcBaser->getTitle()では、サイト名やカテゴリ名等を含んだタイトルを取得できますが、$this->BcBaser->getContentsTitle()では、純粋にコンテンツタイトルのみを取得できます。 |
## 使い方 | ## 使い方 | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | $this->BcBaser->getContentsTitle() | + | echo $this->BcBaser->getContentsTitle() |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
## 戻り値 | ## 戻り値 | ||
(string) | (string) | ||
− | : | + | : コンテンツタイトル |
## 用例 | ## 用例 | ||
行33: | 行15: | ||
####コード | ####コード | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | <?php $this->BcBaser-> | + | <?php echo $this->BcBaser->getContentsTitle(); ?> |
</syntaxhighlight> | </syntaxhighlight> | ||
####出力 | ####出力 | ||
<syntaxhighlight lang="html5"> | <syntaxhighlight lang="html5"> | ||
− | + | このコンテンツのタイトル | |
</syntaxhighlight> | </syntaxhighlight> | ||
### 応用 | ### 応用 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
## 注 | ## 注 | ||
行61: | 行34: | ||
##類似の関数 | ##類似の関数 | ||
− | [ | + | [$this->BcBaser->getTitle()](/関数リファレンス/getTitle) |
− | [[Category: | + | [[Category:関数リファレンス]] |
2016年3月29日 (火) 16:22時点における最新版
説明
$this->BcBaser->getTitle()では、サイト名やカテゴリ名等を含んだタイトルを取得できますが、$this->BcBaser->getContentsTitle()では、純粋にコンテンツタイトルのみを取得できます。
使い方
echo $this->BcBaser->getContentsTitle()
戻り値
- (string)
- コンテンツタイトル
用例
基本
コード
<?php echo $this->BcBaser->getContentsTitle(); ?>
出力
このコンテンツのタイトル