Bin will be removed on June 1, 2014 in favor of http://gist.github.com. Please save all your pastes before then. So long, and thanks for all the fish!×
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
at controller articles_controller.php:
 
function main($id = null,$idcat = null) {
        $articles = $this->paginate();
        $this->set('articles', $this->paginate(array( 'Article.edition_id' => $id, 'Article.category_id' => $idcat)));
        if(isset($this->params['requested'])) {
        return $articles;
        }
     }
 
---------------------------------------------------------
at element featured.ctp:
 
<?php $articles = $this->requestAction('articles/main/*edition_id*/*category_id*/'); ?>
<?php foreach($articles as $article): ?>
<li><? echo $html->link($article['Article']['title'], array('controller'=> 'articles', .$article['Article']['id'])); ?></li>
<?php endforeach; ?>