The difference between page rendering in OC <2.0 and OC 2.0 is just a few, but you should be aware of them.
1. $data
On OC <2.0, you would do this:
$this->data['text_button_save'] = $this->language->get('text_button_save');
whereas in OC 2.0 it is just $data , i.e.
$data['text_button_save'] = $this->language->get('text_button_save');
which is passed to the $this->load->view() method as an argument, for example:
$this->response->setOutput($this->load->view('catalog/category_list.tpl', $data));
2. $this->render()
disappeared. Now you call $this->load->view('catalog/category_list.tpl', $data) .
3. $this->children
disappeared. Now the positions of the template child modules are created as part of the template properties, while you must manually call their controllers (WHY?):
$data['header'] = $this->load->controller('common/header'); $data['column_left'] = $this->load->controller('common/column_left'); $data['footer'] = $this->load->controller('common/footer');
I thought why the hell are these changes necessary. What has been improved? Did they want developers to write less code? Is it now more consistent in terms of OOP, MVC, WTF (sorry)? And he received the answer: NO (or nothing for the first).
We still have to download translations (I mean , we still have to download every line-feed ). And gettext has been there for over 8 years ...
Instead of short $this->response->setOutput($this->render()); we need to call much longer (and incomprehensible) $this->response->setOutput($this->load->view('catalog/category_form.tpl', $data)); . Why can't we just do this: $this->render('catalog/category_form.tpl', $data); ???
I personally think that OC 2.0 is the same excrement (from the point of view of developers) as before. They just changed the packaging. But to be honest, there is even more excrement, so I'm stuck in OpenCart :-)