rodi01
(Oncemade)
February 7, 2010, 4:54am
1
I have a series of widgets (sub widgets) that share common HTML btw them, I was wondering how I could create a "master" widget to output the common HTML.
<div class="module subWidgetNameModule">
<h3>Sub widget Title</h3>
<div class="moduleContent">
...sub widget content...
</div>
</div>
andy_s
(Arekandrei)
February 7, 2010, 8:01am
2
It seems that you need to create a parent widget, and rewrite it’s run() method to output something like:
<div class="module <?=$this->id?>Module">
<h3><?=$this->getTitle()?></h3>
<div class="moduleContent">
<?=$this->getContent()?>
</div>
</div>
All child widgets should provide getTitle() and getContent() methods, so you can declare them as "abstract" in your parent (master) widget.