insert to multiple table MVC Joomla 1.6

193 views
Skip to first unread message

etuate cocker

unread,
Apr 7, 2011, 8:19:45 PM4/7/11
to joomla-...@googlegroups.com
Hi,I am developing a component which uses a single interface to insert data into two different table. The problem I am having is that the edit.php file currently in the joomla 1.6 helloworld uses pointers to unique id for a single table. Any help in this is highly appreciated.

thanks

Etuate


Amy Stephen

unread,
Apr 14, 2011, 1:42:19 PM4/14/11
to joomla-...@googlegroups.com
I recommend going with two controllers to keep things simple - but if that's not going to work, then you need a separate set of views, tables, xml files, and controllers for each of your tables. 

You'll have to pick one to be your default -- so that it's used when no view is provided, otherwise, you need to make certain that the view is specified in your links, form actions, and buttons.

The core component to look at is the banners - specifically, the banner and client views/etc.

Good luck!

Amy Stephen

unread,
Apr 14, 2011, 1:43:41 PM4/14/11
to joomla-...@googlegroups.com
I recommend going with two controllers to keep things simple 

I meant to say - I recommend going with two components....(sorry!)

etuate cocker

unread,
Apr 14, 2011, 3:16:34 PM4/14/11
to joomla-...@googlegroups.com
Amy, Thanks for your reply. I did tried to put two different controllers,views,xml etc but still receiving error "Uncaught Invalid controller class: UoaphControllerUoaphown. Is there any online resources which shows how to create two controllers,tables,views,xml for two different tables. I am using joomla version 1.6.

thanks
 
Etuate Cocker



--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To post to this group, send an email to joomla-...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.

Amy Stephen

unread,
Apr 14, 2011, 4:07:17 PM4/14/11
to joomla-...@googlegroups.com
Well, that was my concern - most find it challenging enough to create a Component and you are taking things to a more challenging level.

You can create two components -- and then add a new view with icons that make it easy to integrate visually. 

But, I recommend looking closely at the Core Banners Component? That's where I would look. Documentation is lacking - but, the truth is, nothing is better than the core code for seeing how it works.

Also, in the Component entry point, check out your Request Variables and know what your buttons and menu items and links are doing. It's key that you have that view in the links and that you understand how the defaulting works. 

Specifically with these - 
        JRequest::getCmd('task',);
        JRequest::getCmd('layout');
        JRequest::getCmd('view');

I assume you understand that the various tasks have the Controller/View name embedded? content.add, weblinks.edit, contacts.checkin, etc., JController will take care of reseting the task to it's correct value (add, edit, checkin, etc.), but you need to make certain those tasks hit the execute statement with the Controller/View appended. 

It's do-able, just challenging. You'll move to the head of the class when you are done. ;-)

Best,
Amy
Reply all
Reply to author
Forward
0 new messages