Sub widgets and Master widget

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>



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.