Same name and namespace in other branches
  1. 7.x-3.x quicktabs.classes.inc \QuickPreRenderedContent::__construct()

Constructor

File

src/QuickPreRenderedContent.php, line 41

Class

QuickPreRenderedContent
This class implements the same interface that content plugins do but it is not a content plugin. It is a special class for pre-rendered content which is used when "custom" tabs are added to existing Quicktabs instances in a call…

Namespace

Drupal\quicktabs

Code

public function __construct($item) {
    $contents = isset($item['contents']) ? $item['contents'] : array();
    if (!is_array($contents)) {
        $contents = array(
            '#markup' => $contents,
        );
    }
    $this->rendered_content = $contents;
    $this->title = isset($item['title']) ? $item['title'] : '';
    unset($item['title'], $item['contents']);
    $this->settings = $item;
}