個人用ツール

「ver4/関数リファレンス/getRelatedPosts」の版間の差分

提供: baserCMS公式ガイド

移動: 案内, 検索
(1版 : 関数リファレンス→ver4)
 
行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())
+
* (array) $options オプション
- `recursive` : 関連データを取得する場合の階層(初期値 : -1)
+
: 初期値 : array()
- `limit` : 件数(初期値 : 5)
+
: - `recursive` : 関連データを取得する場合の階層(初期値 : -1)
- `order` : 並び順指定(初期値 : BlogPost.posts_date DESC)
+
: - `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)

用例

基本

コード

 

出力

応用

コード

出力

変更履歴

ソースファイル

関連資料

類似の関数