■ユーザーズフォーラム リニューアルのお知らせ
新規投稿は新ユーザーズフォーラムにお願いします。

Re: 取得した複数のブログ記事を日付順にならべたい

tomato > Re: 取得した複数のブログ記事を日付順にならべたい @ 2015/8/27 12:22
ご返信ありがとうございます。
default.php
に以下を記載してみましたところ、エラーとはなりませんでしたが、
何も表示されませんでした。


<?php if ($this->BcBaser->isHome()): ?>
<?php
$BlogPost = new BlogPost();
?>
<?php
$posts = $BlogPost->find('all', array(
'conditions' => array_merge($BlogPost->getConditionAllowPublish(), array(
'BlogPost.blog_content_id' => array(1,2,3,4) //blog IDを指定
)),
'order' => array('BlogPost.posts_date DESC'), //並び順:日付順
'limit' => 3 //記事取得件数
));
?>

<?php endif ?>



= new BlogPost();をはずし、以下としてもやはり
何も表示されませんでした。



<?php if ($this->BcBaser->isHome()): ?>
<?php
$posts = $BlogPost->find('all', array(
'conditions' => array_merge($BlogPost->getConditionAllowPublish(), array(
'BlogPost.blog_content_id' => array(1,2,3,4) //blog IDを指定
)),
'order' => array('BlogPost.posts_date DESC'), //並び順:日付順
'limit' => 3 //記事取得件数
));
?>

<?php endif ?>



引数の順番とか、指定に抜けとかがあるのでしょうか?
すいません。PHPがわからないので、お手数ですが、教えていただけますと幸いです。
よろしくお願いします。

スマートURL: OFF
レンタルサーバー名:ロリポップ
セーフモード:Off
データベース: SQLite
baserCMSバージョン: 3.0.7
CakePHPバージョン: 2.5.3
PHPスキル(自己評価):全くわからない

ログイン
ユーザー名:
パスワード:


  新規登録 / パスワード紛失

検索

facebook
フォーラムで悩みが解決した場合など、よかったら「いいね!」をポチっとクリックしてください!質問の回答者や開発者の励みになります

フォーラムガイド


関連リンク

オンライン状況
8 人のユーザが現在オンラインです。 (8 人のユーザが フォーラム を参照しています。)

登録ユーザ: 0
ゲスト: 8