문제

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