Note that there are some explanatory texts on larger screens.

plurals
  1. POjoomla 1.6, component: How to do component to link between 2 tables with m2m and display list in edit page?
    text
    copied!<p>I'm new to Joomla! and also new to the component development.</p> <p>I want to create a component which be able to link between 2 tables.</p> <p>joomla v 1.6:</p> <p>A table's structure:</p> <pre><code>CREATE TABLE `#__a` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; </code></pre> <p>B table's structure:</p> <pre><code>CREATE TABLE `#__b` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; </code></pre> <p>AB table's structure:</p> <pre><code>CREATE TABLE `#__ab` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_a` int(11) NOT NULL, `id_b` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; </code></pre> <p>Assume that we have already created the basic create, edit page and delete action with the MVC for A and B (<a href="http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!1.6_-_Part_01" rel="nofollow">created from the hello world component</a>). From the hellow world tutorial we could know clear about the file and folder structure and the componet's code, but in the tutorial there is only 1 table, but here there is 2 tables and also new id id table. </p> <p>So it means that in the component we're developing here, there are 2 submenus.</p> <p>In the edit or new page</p> <ol> <li><p>There is A details block which we can fill name.(done from the tutorial)</p></li> <li><p>There is B linking block which we can choose the B (select option, can select more then 1) to add into the A and also display list the B we added. In every item in the list, it has a delete button or link to unlink between the A and B.</p></li> </ol> <p>Any ideas how to do please?</p> <p>Thanks and Best Regards Friends,</p> <p>Rithy</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload