You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: migrations/52-53/new-deprecations.md
+25-5Lines changed: 25 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,8 @@ $model = $this->getModel();
23
23
$this->items = $model->getItems();
24
24
```
25
25
#### Explanation
26
-
Joomla and most extensions have extensively been using `Joomla\CMS\MVC\View\AbstractView::get()` in all views. From 5.3 onwards, this method is deprecated and is going to be removed in Joomla 7.0.
26
+
Joomla and most extensions have extensively been using `Joomla\CMS\MVC\View\AbstractView::get()` in all views. From 5.3 onwards,
27
+
this method is deprecated and is going to be removed in Joomla 7.0.
27
28
28
29
This code in the past was used to retrieve data from the model. It was included in the `HtmlView.php` and often looked like this:
29
30
```php
@@ -35,9 +36,12 @@ public function display($tpl = null)
35
36
parent::display($tpl);
36
37
}
37
38
```
38
-
This code in the view called the method `get<FirstArgument>` on the model and returned the result. If the model didn't have such a method, it returned the classes attribute named by the first argument.
39
+
This code in the view called the method `get<FirstArgument>` on the model and returned the result. If the model didn't have such a method,
40
+
it returned the classes attribute named by the first argument.
41
+
42
+
The downside of this is an indirection which no IDE and static code analyser can understand and which hides errors. The better
43
+
solution is to call the model directly, making it easy for an IDE to understand the code. The new code should look like this:
39
44
40
-
The downside of this is an indirection which no IDE and static code analyser can understand and which hides errors. The better solution is to call the model directly, making it easy for an IDE to understand the code. The new code should look like this:
41
45
```php
42
46
public function display($tpl = null)
43
47
{
@@ -49,7 +53,10 @@ public function display($tpl = null)
49
53
parent::display($tpl);
50
54
}
51
55
```
52
-
The first line is a docblock comment, which provides a hint for the IDE for the actual model that is used. The second line will retrieve the model set in the view. If you have more than one model in a view, you can provide it with a parameter to select the right model. The last two lines retrieve the actual data from the model. With the first two lines, IDEs can hint at the available methods in the model and now the returned values from those methods, making it possible to find issues further down the line.
56
+
The first line is a docblock comment, which provides a hint for the IDE for the actual model that is used.
57
+
The second line will retrieve the model set in the view. If you have more than one model in a view, you can provide it with a parameter to select the right model.
58
+
The last two lines retrieve the actual data from the model. With the first two lines, IDEs can hint at the available methods in the model
59
+
and now the returned values from those methods, making it possible to find issues further down the line.
PHP 7 had a security issue with .phar packages. To circumvent the issue, the TYPO3 project created this wrapper. In PHP 8.0 this has been fixed in PHP and the whole wrapper is not needed anymore. This package will be removed in 6.0.
84
+
85
+
PHP 7 had a security issue with .phar packages. To circumvent the issue, the TYPO3 project created this wrapper.
86
+
In PHP 8.0 this has been fixed in PHP and the whole wrapper is not needed anymore. This package will be removed in 6.0.
0 commit comments