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
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ Joomla and most extensions have extensively been using `Joomla\CMS\MVC\View\Abst
27
27
this method is deprecated and is going to be removed in Joomla 7.0.
28
28
29
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:
30
+
30
31
```php
31
32
public function display($tpl = null)
32
33
{
@@ -36,6 +37,7 @@ public function display($tpl = null)
36
37
parent::display($tpl);
37
38
}
38
39
```
40
+
39
41
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
42
it returned the classes attribute named by the first argument.
41
43
@@ -53,11 +55,43 @@ public function display($tpl = null)
53
55
parent::display($tpl);
54
56
}
55
57
```
58
+
56
59
The first line is a docblock comment, which provides a hint for the IDE for the actual model that is used.
57
60
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
61
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
62
and now the returned values from those methods, making it possible to find issues further down the line.
0 commit comments