「ver4/関数リファレンス/BcBaser contentsName」の版間の差分
提供: baserCMS公式ガイド
細 (1版 : 関数リファレンス→ver4) |
Katokaisya (トーク | 投稿記録) |
||
行10: | 行10: | ||
## 使い方 | ## 使い方 | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | $this->BcBaser->contentsName( [$detail] ); | + | $this->BcBaser->contentsName( [$detail], [$options] ); |
</syntaxhighlight> | </syntaxhighlight> | ||
行19: | 行19: | ||
- 初期値:false | - 初期値:false | ||
+ | |||
+ | $options | ||
+ | : オプション | ||
+ | : ※ オプションの詳細については、BcBaserHelper::getContentsName() を参照 | ||
+ | |||
+ | - 初期値:array() | ||
## 戻り値 | ## 戻り値 |
2016年11月1日 (火) 12:32時点における版
[このコンテンツは内容調整中です]
目次
説明
コンテンツを特定する文字列を出力する。
URLを元に、第一階層までの文字列をキャメルケースで出力する。
bodyタグ等にid属性として設定し、コンテンツごとに適用されるCSSを切り替えたりする場合に便利です。カテゴリに属さないページでは「Default」を出力します。
例:http://xxx.xx/contact/index の場合、「Contact」を出力
使い方
$this->BcBaser->contentsName( [$detail], [$options] );
パラメータ
- $detail
- true に設定すると詳細な名称までを取得します。
-
(例)http://xxx.xx/contact/index の場合、「ContactIndex」を出力
- 初期値:false
- $options
- オプション
-
※ オプションの詳細については、BcBaserHelper::getContentsName() を参照
- 初期値:array()
戻り値
なし
用例
基本
コード
<body id="<?php $this->BcBaser->contentsName() ?>">
出力
<body id="Contact">