What is the way to call components model method in a joomla module. I know there is a helper file inside of custom module and that should do the job, but how they do that?

有帮助吗?

解决方案

It doesn't matter if you do it in the helper file or in the main file. The helper file is just a nice place to stuff away this kind of code :)

To call the model you need to include it first since it's not autoloaded. That means usually using something like require_once('components/com_content/models/article'). After that you can instantiate the class with $class = new ContentModelArticle and call the method $item = $class->getItem(). That should at least work in theory :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top