Tu ne dois pas avoir de category indiquée dans ton url tout simplement.
j'ai un petit problème sur les liens de ma sidebar suite au tuto 3eme jour pour développer un site
voici le message d'erreur
Missing argument 1 for PostsController::category() [APP\Controller\PostsController.php, line 23]
Undefined variable: category [APP\Controller\PostsController.php, line 25]
function category($category){
$cat = $this->Post->Category->find('first',array('conditions' => array('slug' => $category)));
if(empty($cat))
throw new NotFoundException('Aucune page ne correspond à cet ID');
$d'posts'] = $this->Paginate('Post',array('type'=>'post','online'=>1,'category_id'=> $cat'Category']'id']));
$this->set($d);
$this->render('index');
}
quelqu'un peut orienté
merci
5 réponses
et pourtan je point bien sur category et le slug
Quand tu appelles cette fonction, tu as quoi dans ton url ?
voici quand je click
http://127.0.0.1/tuto/posts/Category/slug:comparateur
Merci slyvaan
j'ai trouvé j'ai juste mis un C majuscule dans ma function afterFind erreur été "'action' => 'Category'" ce qui et faux le bon et 'action' => 'category'.
merci encore tu ma bien aider