「ver4/関数リファレンス/getRelatedPosts」の版間の差分
提供: baserCMS公式ガイド
Tomohiro Abe (トーク | 投稿記録) (ページの作成:「## 説明 同じタグの関連投稿を取得する ## 使い方 <syntaxhighlight lang="php"> $this->Blog->getRelatedPosts(); </syntaxhighlight> ## パラメータ *...」) |
Katokaisya (トーク | 投稿記録) |
||
(他の1人の利用者による、間の1版が非表示) | |||
行7: | 行7: | ||
## 使い方 | ## 使い方 | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | $this->Blog->getRelatedPosts(); | + | $this->Blog->getRelatedPosts( [$post] , [$options] ); |
</syntaxhighlight> | </syntaxhighlight> | ||
## パラメータ | ## パラメータ | ||
* (array) $post ブログ記事 | * (array) $post ブログ記事 | ||
− | * (array) $options | + | * (array) $options オプション |
− | + | : 初期値 : array() | |
− | + | : - `recursive` : 関連データを取得する場合の階層(初期値 : -1) | |
− | + | : - `limit` : 件数(初期値 : 5) | |
+ | : - `order` : 並び順指定(初期値 : BlogPost.posts_date DESC) | ||
2016年11月4日 (金) 21:11時点における最新版
[このコンテンツは内容調整中です]
目次
説明
同じタグの関連投稿を取得する
使い方
$this->Blog->getRelatedPosts( [$post] , [$options] );
パラメータ
- (array) $post ブログ記事
- (array) $options オプション
- 初期値 : array()
- -
recursive
: 関連データを取得する場合の階層(初期値 : -1) - -
limit
: 件数(初期値 : 5) - -
order
: 並び順指定(初期値 : BlogPost.posts_date DESC)
戻り値
(array)