× Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

two views of two tables in one

9 år 5 måneder siden #770 af Michele Calzone
two views of two tables in one blev oprettet af Michele Calzone
is possibile to combine two views of two tables in one ? if you like ?

Venligst Log på eller Opret en konto for at deltage i samtalen

9 år 3 måneder siden #841 af Anthony Ceccarelli
Besvaret af Anthony Ceccarelli på emne two views of two tables in one
Hello,
yes, it's possible to show data from two or more tables in one view. I had to do that so I searched for it. It's quite simple but I don't know if it's the right way :
For a list of items, in the view.html.php I add these lines (Joomla 3) :
$model2 = JModelList::getInstance('NameOfYourModel', 'YourComponentModel');
 $this->modelData = $model2->getItems();
Then in the default.php (for example) use a foreach function to get the data :
foreach ($this->modelData as $key=>$value) {
echo $value->id;
echo $value->category;
//... etc
}
Hope it helps !

Easy Timetable, a user-friendly schedule management system build with Component Creator
Følgende bruger(e) sagde tak: Andres Maeso

Venligst Log på eller Opret en konto for at deltage i samtalen

Tid til at oprette siden: 0.094 sekunder
Leveret af Kunena Forum

Vi we benytter cookies, så vi bedst muligt kan levere vores services. For mere information, se vores