-
Notifications
You must be signed in to change notification settings - Fork 42
Description
public function initialize(): void
{
parent::initialize();
$this->loadComponent('Flash');
$this->loadComponent('Crud.Crud', [
'actions' => [
'Crud.Index',
'Crud.View',
'Crud.Add',
'Crud.Edit',
'Crud.Delete',
'Crud.Lookup',
],
'listeners' => [
// New listeners that need to be added:
'CrudView.View',
'Crud.Redirect',
'Crud.RelatedModels',
]
]);
$this->Crud->useModel('MyOtherPluginWithTables.'.$this->Crud->model()->getAlias());
}
Results in:
Missing Route
Cake\Routing\Exception\MissingRouteException
Error A route matchingarray ( 'plugin' => 'MyOtherPluginWithTables', 'controller' => 'Customers', 'action' => 'view', 0 => 1, 'prefix' => 'Backend', '_ext' => NULL, )could not be found.
The plugin alias is being automatically picked up from the table name in dot notation here:
crud-view/src/Listener/ViewListener.php
Line 578 in 28f1bcd
| $associationConfiguration[$type][$assocKey]['plugin'] = pluginSplit($association->getClassName())[0]; |
Using it in link generation has been introduced in #138
I looked at the code and there doesn't seem to be an obvious way to tell the system that while I use the table from another plugin, the links shouldn't refer to it.
I'm hoping there's a way to somehow pass some flag through in an event callback of some kind?