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

two views of two tables in one

9 năm 7 tháng trước #770 bởi Michele Calzone
two views of two tables in one was created by Michele Calzone
is possibile to combine two views of two tables in one ? if you like ?

Vui lòng Đăng nhập hoặc Tạo tài khoản để tham gia cuộc hội thoại.

9 năm 6 tháng trước #841 bởi Anthony Ceccarelli
Replied by Anthony Ceccarelli on topic 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
Những thành viên sau(s) đã Cảm ơn: Andres Maeso

Vui lòng Đăng nhập hoặc Tạo tài khoản để tham gia cuộc hội thoại.

Thời gian tải trang: 0.052 giây
Powered by Kunena Forum

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.