Joomla issue - "$this->items = $this->get('Items'); does not work anymore under PHP 7.1 and 7.2

by Andreas Isele   Last Updated January 04, 2018 17:10 PM

In my component I am assigning the data from the model to the view using

class FileUploaderViewFileUploader extends JViewLegacy
// Overwriting JView display method
function display($tpl = null)
// Assign data to the view
$this->items = $this->get('Items'); // => This causes the error
// Display the view

The error at my website I get is:
Error: 0
Using $this when not in object context

Anybody an idea what happened here? This code worked well under PHP 5.6.x as well as PHP 7.0.26.
Thank you in advance.

Best regards

Tags : php7

Related Questions

A PHP 7 question concerning =&

Updated June 08, 2017 15:10 PM

different templates based on $item number

Updated February 17, 2018 15:10 PM

Issue with upgrade to php7 and new mysql

Updated June 10, 2016 08:04 AM