Is there a way to use module A inside module B's compile method?
Let a me explain, what I am looking for is a way to (import/render/call a function - what ever you might call this) module A's functionality inside module B's compile method. Depending on results of module A's inside Module B's compile method, i want to carry out further steps in module B.Code:module A extends Module module B extends ModuleXYZ
And I saw this post:
viewtopic.php?f=9&t=1712
also I read this blog
http://blog.qzminski.com/2010/06/using- ... er-module/
But i can't solve my problem :-(
Issues are so:
1 . Inside moduleB's compile function if i use :
Throws error - Creating default object from empty value in ... on line xyzCode:$sqlRes = $this->Database->prepare("SELECT * FROM tl_moduleA")->execute(); $objModule = new ModuleA($sqlRes); $objModule->compile();
line xyz has $this->Template->moduleA = $someResult;
2.
I can't use
because of following errorsCode:$this->Import('moduleA'); $result = $this->moduleA->methodA();
Argument 1 passed to Module::__construct() must be an instance of Database_Result, Now the only option is moduleA to extend Frontend. Which in turn throws an error call to undefined method moduleA::generate(). Well I can put an empty generate funtion but in whole it breaks the moduleA standalone functionality.
3.
class ModuleA extends ModuleParent
{
// ...
}
class ModuleB extends ModuleParent
{
// ...
}
This i can't do because ModuleA and ModuleB 2 totally different animal. Can someone show me a way to do it. Thanks lot
Bookmarks