This is my controller method that I am trying to call and I have edited the routes.php so that it calls it and it finds it.
/**
* Add method
* //TODO You can set the company and it works as it is supposed to, but when you have an error regarding the editions not set, you just need to return. This needs to be done later on.
* @return \Cake\Network\Response|void Redirects on successful add, renders view otherwise.
*/
public function add()
{
parent::_add();
$this->set('columns', [
'title' => ['title' => __d('cockpit', 'Companies'), 'label' => 'Company']
]);
$this->set("dataAddUrl", '/customerBehaviors/add');
}
I have a problem with rendering the view.
When I put inside this method $this->render('add.ctp'); then it renders the right view, in any other case it just doesn't. In the error itself it doesn't say it goes to the right route. Which is this /srv/www/cemcloud2/plugins/Cloud/src/Template/CustomerBehaviors/add.ctp I don't know how to add this so that it goes directly there. I want to achieve this without rendering the view using $this->render('add');
We are using both plugins and src directories and in our source directory is the one that I want to inherit from my view. (I believe last sentence doesn't make much relevance to the issue itself). Could someone tell me what am I doing wrong ?