「ver4/関数リファレンス/Blog postTitle」の版間の差分
提供: baserCMS公式ガイド
Katokaisya (トーク | 投稿記録) |
|||
(2人の利用者による、間の2版が非表示) | |||
行5: | 行5: | ||
##使い方 | ##使い方 | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | <?php $this->Blog->postTitle($ | + | <?php $this->Blog->postTitle( [$pos] t, $link) ?> |
</syntaxhighlight> | </syntaxhighlight> | ||
##パラメーター | ##パラメーター | ||
<dl> | <dl> | ||
− | <dt>$post</dt> | + | <dt>(array)$post</dt> |
<dd> | <dd> | ||
ブログ記事のデータを指定します。ブログ記事を出力するループ内では「$post」と記述すれば動作します。 | ブログ記事のデータを指定します。ブログ記事を出力するループ内では「$post」と記述すれば動作します。 | ||
</dd> | </dd> | ||
− | <dt>$link</dt> | + | <dt>(boolean)$link</dt> |
<dd> | <dd> | ||
− | + | 詳細ページへのリンクをつける場合には、true を指定します。 | |
− | + | : 初期値 : true | |
</dd> | </dd> | ||
</dl> | </dl> | ||
##戻り値 | ##戻り値 | ||
<dl> | <dl> | ||
− | <dt>( | + | <dt>(void)</dt> |
− | <dd> | + | <dd></dd> |
</dl> | </dl> | ||
2016年11月4日 (金) 21:32時点における最新版
[このコンテンツは内容調整中です]
目次
説明
ブログテンプレート内に記述することで、記事タイトルを出力します。
使い方
<?php $this->Blog->postTitle( [$pos] t, $link) ?>
パラメーター
- (array)$post
- ブログ記事のデータを指定します。ブログ記事を出力するループ内では「$post」と記述すれば動作します。
- (boolean)$link
-
詳細ページへのリンクをつける場合には、true を指定します。
- 初期値 : true
戻り値
- (void)
用例
基本
コード
<?php $this-Blog->postTitle($post, $link = true) ?>
出力
<a href="/news/archives/2">新商品を販売を開始しました。</a>
応用
コード
<?php $this->Blog->postTitle($post, false); ?>
出力
"新商品を販売を開始しました。"