Hello,
I'm starting with Joomla (2.5) and want to create a component.
I have two tables: googleaccounts and imports
Each table is managed by a view, but the view ViewImports, I also need to use the model "googleaccounts".The $this->getModel returns data only if I send parameters or if you use the model of the same view.
If you use another model, then I get this error:
Notice: Undefined index: googleaccounts in /Users/lsri8088/Sites/joomla/joomla/libraries/joomla/application/component/view.php on line 413I created the component with an application that generates all files but only allows you to use a table. Then I created the same component, with a different table, and then I merged the two folders, files merging. Did I do something wrong, any configuration files?
Thanks in advance, and greetings.
$this->setModel(JModelLegacy::getInstance('googleaccounts'), false);
Fatal error: Call to a member function getName() on a non-object in /Users/lsri8088/Sites/joomla/joomla/libraries/joomla/application/component/view.php on line 481
The first parameter is "The model type to instantiate", googleaccounts in your case.Second parameter is "Prefix for the model class name", LsricalendarModel.For this to work I believe your class name should be LsricalendarModelGoogleaccounts, and this class should be in file googleaccounts.php.Then you can do something like this:$this->setModel(JModelLegacy::getInstance('Googleaccounts', 'LsricalendarModel'));