Hi! I have problem 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.
<?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.