「関数リファレンス/Blog postTitle」の版間の差分
提供: baserCMS公式ガイド
(ページの作成:「##説明 ブログテンプレート内に記述することで、記事タイトルを出力します。 ##使い方 <syntaxhighlight lang="php"> <?php $this->Blog->...」) |
細 |
||
行20: | 行20: | ||
##戻り値 | ##戻り値 | ||
<dl> | <dl> | ||
− | <dt>( | + | <dt>(string)</dt> |
<dd>文字列を出力します。</dd> | <dd>文字列を出力します。</dd> | ||
</dl> | </dl> |
2015年4月28日 (火) 17:44時点における版
目次
説明
ブログテンプレート内に記述することで、記事タイトルを出力します。
使い方
<?php $this->Blog->getPostLink($post, $link) ?>
パラメーター
- $post
- ブログ記事のデータを指定します。ブログ記事を出力するループ内では「$post」と記述すれば動作します。
- $link
-
記事へのリンクの出力を指定します。
- 初期値 : true
戻り値
- (string)
- 文字列を出力します。
用例
基本
コード
<?php $this-Blog->postLink($post, $link = true) ?>
出力
<a href="/news/archives/2">新商品を販売を開始しました。</a>
応用
コード
<?php $this->Blog->postLink($post, false); ?>
出力
"新商品を販売を開始しました。"