<?php if($showOnlyBundle == true) {
            natcasesort($viewdata);
            foreach ((array) $viewdata as $name) { ?><li class="only_bundle"><?= htmlspecialchars($name) ?></li>
            <?php }
   }
    elseif($showOnlyHandle==true){
        foreach ((array) $viewdata['data'] as $index => $data) { ?>
        <li><?php
        $url = sprintf('<a class="handleClick" href="%s/policies/index/handle/%s" rel="%s" title="handle">%s</a>', site_url (),$data[0], $data[0], $data[0]);
        $url= generateLink('policies',$url,'<a>'.$data[0].'</a>');
        echo $url?></li>
       <?php }
       }
    else {
    foreach ((array) $viewdata['data'] as $index => $data) { ?>
        <li><span class="type"><?= htmlspecialchars($data[3]) ?></span><p><?php echo sprintf('<a href="%s/policies/index/handle/%s" class="promiselnk" title="promise"><span class="promiser">%s</span></a>', site_url(),urlencode($data[0]), $data[4]);
        ?><?php if (!$showOnlyHandle) echo sprintf('<a class="handleClick" href="%s/policies/index/handle/%s" rel="%s" title="handle"><span class="handle">%s</span></a>', site_url (),$data[0], $data[0], $data[0]);
        ?><?php if (!$showOnlyHandle) echo sprintf('<a href="%s/policies/index/bundle/%s/type/%s" title="bundle"><span class="bundle">%s</span></a>', site_url (),$data[2], $data[3], $data[2]);
        ?></p></li>
    <?php } ?>
<?php } ?>