I have a project of CakePHP 3.1 and I'm looking for a way to pass as parameter an Entity object and an array to a controller using the FormHelper postLink.
What I have already tried:
echo $this->Form->postLink(
__('Unlink'),
['action' => 'unlink', $entity, $array],
['confirm' => __('Are you sure to unlink {0}?', $array['name'])]);
My controller:
public function unlink($entity,$array)
{
$theTable = TableRegistry::get('tableName');
$theTable->Model->unlink($entity, $array);
return $this->redirect($this->referer());
}
This is displaying a pretty known error:
rawurlencode() expects parameter 1 to be string
But I haven't find any post that fits my needs, I guess it is because I need to pass an object instead of basic types.
Any help or better alternative is appreciated.