0

Here is my little concern, I would like to display my data from my database on a page, the display goes without worries, nevertheless I would like this data to be displayed from the second occurrence. Would anyone have an idea of how to do it? I put you my controller file and my ctp file just below. thank you in advance I specify that I am a novice no cakephp My controller file:

class ArticlesController extends AppController {
public function index(){
$this->paginate = array('all',
    'conditions' => array('Article.statu' => '1'),
    'limit' => 4,
    'order' => array('Article.id' => 'desc')
);
   $this->set('articles', $this->paginate('Article'));

}
}

My index.ctp :

 <?php
                    $paginator = $this->Paginator;
                    foreach ($articles as $article){
                        echo'
                    <div class="single-blog-post featured-post mb-30">
                        <div class="post-thumb">';
                            echo $this->Html->image($article['Article']['image'], array('style' => 'height:484px!important;width:1000px!important;', 'url' => array('controller' => 'articles', 'action' => 'detail_article', h($article['Article']['id']))));
                        echo'</div>';
                       echo' <div class="post-data">
                            <a class="post-title one">
                                <h6>';echo $article['Article']['titre']; echo'</h6></a>';

                            echo'<div class="post-meta">';
                                echo'<p class="post-author">Ajouté le '; echo $article['Article']['date'];echo'</p>';
                               echo' <p>';echo substr($article['Article']['bigresume'],0,400);echo'...</p>';
                                echo'
                            </div>
                        </div>
                    </div>';
                }
               ?>

0 Answers0