etabbeddiv

A simple way to generate a div with tabbed contents
2 followers

This short extension allow you to easily add a div containing tabs.

Requirements

  • Yii 1.1 or above
  • jquery ui

Usage

Just initialise the widget with the required params:

<?php $this->widget('application.extensions.ETabbedDiv',
   array(
      'divClass' => 'tabbed',
      'tabs' => array(
         'tab1' => array('content' => '<p>this is the first tab</p>'),
         'tab2' => array('title'=>'Second', 'content' => '<p>this is the second tab</p>'),
         'other' => array('content' => '<p>this is the third and last tab</p>'),
      ),
   ),
);
?>

Whith:

  • divClass (optional) : the css class for the main div,
  • tabs : an associated array, the key is the id of the tab (must be unique) and the value is another array:
    • title (optional) : the title displayed in the tab. If not set, the id is used,
    • content : the html content of the tab

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads