「ver4/関数リファレンス/postDetail」の版間の差分
提供: baserCMS公式ガイド
Katokaisya (トーク | 投稿記録) (ページの作成:「[このコンテンツは内容調整中です] ## 説明 記事の詳細を表示する ## 使い方 <syntaxhighlight lang="php"> $this->Blog->postDetail($post, [$opti...」) |
|||
(他の1人の利用者による、間の1版が非表示) | |||
行1: | 行1: | ||
− | |||
− | |||
## 説明 | ## 説明 | ||
記事の詳細を表示する | 記事の詳細を表示する | ||
行6: | 行4: | ||
## 使い方 | ## 使い方 | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | $this->Blog->postDetail($post, [$options] ) | + | $this->Blog->postDetail( [$post] , [$options] ) |
</syntaxhighlight> | </syntaxhighlight> | ||
## パラメータ | ## パラメータ | ||
(array) $post | (array) $post | ||
− | : | + | : ブログ記事データ |
(array) $options | (array) $options | ||
行21: | 行19: | ||
## 戻り値 | ## 戻り値 | ||
(void) | (void) | ||
+ | : | ||
## 用例 | ## 用例 | ||
行26: | 行25: | ||
####コード | ####コード | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
+ | <?php $this->Blog->postDetail($post); ?> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
####出力 | ####出力 | ||
<syntaxhighlight lang="html5"> | <syntaxhighlight lang="html5"> | ||
+ | $postのブログ記事本文 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
行35: | 行36: | ||
####コード | ####コード | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | + | <?php $this->Blog->postDetail($post, ['cut' => 30]); ?> | |
</syntaxhighlight> | </syntaxhighlight> | ||
####出力 | ####出力 | ||
<syntaxhighlight lang="html5"> | <syntaxhighlight lang="html5"> | ||
− | + | 30文字にカットされた$postのブログ記事本文 | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:関数リファレンスver4]] | [[Category:関数リファレンスver4]] |
2018年6月11日 (月) 15:47時点における最新版
説明
記事の詳細を表示する
使い方
$this->Blog->postDetail( [$post] , [$options] )
パラメータ
- (array) $post
- ブログ記事データ
- (array) $options
- オプション 初期値 : array()
cut
: 文字をカットするかどうかを真偽値で指定。カットする場合、文字数を数値で入力(初期値 : false)
戻り値
- (void)
用例
基本
コード
<?php $this->Blog->postDetail($post); ?>
出力
$postのブログ記事本文
応用
コード
<?php $this->Blog->postDetail($post, ['cut' => 30]); ?>
出力
30文字にカットされた$postのブログ記事本文