User tests: Successful: Unsuccessful:
I've added to methods to the Joomla\CMS\MVC\View\AbstractView Class:
$properties
to get
method. If you want to also provide properties to the model method, you can use other$this->getModel("Article")->getById($id)
get
method:$this->get("ById", "Article", $id)
getAll
as a shorthand to get all Data of a Model. Until now, you could also only call a method to display all data via the model directly:$this->getModel("Article")->getArticles()
getAll
method:$this->getAll("Article")
-> $this->get("Articles, "Article") If you have a specific list function (e.g. getAllArticles), you can also provide a second parameter $property, otherwise the model name will automatically be transformed into a plural noun.
$this->getAll("Article", "Fields")->
$this->get("Fields", "Article")`s. above.
Accessing the model directly in Views needed to call specific methods
More convenient methods in AbstractView
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Title |
|
Labels |
Added:
PR-4.4-dev
|
Title |
|
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-10-26 11:59:32 |
Closed_By | ⇒ | rdeutz |
Sorry, this is not the way we want it. As you by yourself noticed you get all the inforamtion with calling the model, your addition doesn't make things easier.