I'm creating a component in Joomla! 3.1.4 which contains multiple models. What I would like to accomplish is to add multiple models B that associate with model A in A's edit view.
To be specific, I want to keep adding unlimited number of model B to connect to model A when I am editing model A. And provide a simple list of B's in A's edit view.
This can of course be done in B's edit views, or fully hard coded within A's edit view. I believe Joomla! should have some methods to accomplish that to avoid code duplications.
Can anyone please shed a light on this? Thanks!
The Joomla Doc's website covers this subject in the article "Using multiple models in an MVC component"
To call another model from the view, in the view display() method
$modelA = $this->getModel('ModelA');
$modelB = $this->getModel('ModelB');