User tests: Successful: Unsuccessful:
No Issue (Just something that annoyed me tbh)
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-5.1-dev
|
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-10-23 08:25:03 |
Closed_By | ⇒ | CraftException |