How show the list of elements from one category

Hi! I have problem :frowning: How can I show the list of elements from one category. I mean:

  • I have list of film’s category
  • I want to click on the name and go to list with this category. eg. In my DB there are 10 films (action, comedy etc.) I click on the “comedy” and I see only films from these category.

I hope you can understand me :stuck_out_tongue:

Thanks!

How your models looks like?

<?php namespace App\Model\Table; use Cake\ORM\Query; use Cake\ORM\RulesChecker; use Cake\ORM\Table; use Cake\Validation\Validator; class GamesTable extends Table { public function initialize(array $config) { parent::initialize($config); }

You’d need to add an additional parameter to your category links with the category id. Then, in the method that lists the films (probably index) you’ll have to add a condition to filter by the category_id parameter sent by the link.