Как изменить массив, который произошел с индексом - PullRequest
0 голосов
/ 04 марта 2020

Мой индекс

public function index()
{
    $this->paginate = [
        'contain' => ['Photos'],
    ];
    $tareas = $this->paginate($this->Tareas);

    $this->loadModel('Categorias');

    $categorias = $this->Categorias->find()->all();


    $this->set(compact('tareas','categorias'));
}

Я хочу изменить содержимое тарных сборок, когда я вызываю эту функцию, чтобы отображать другой контент в моем индексе

public function getTareas()
{
    $tareas = $this->Tareas->find()->where(['categoria_id'=>$this->request->getData()['idcategoria']])->all();
    $this->set(compact('tareas'));
    return $this->redirect(['action' => 'index']);

}

Я попробовал следующее, но это не работает

...