for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Alireza Josheghani <[email protected]>
* @version 1.0
* @package SideNav
* @since 8 Oct 2016
* SideNav helper methods
*/
namespace Anetwork\SideNav;
trait SideNavHelpers {
* Check menu has sub
* @param $menu
* @return bool
public static function hasSub($menu)
{
// check menu has sub
if(! empty($menu['sub']))
return true;
return false;
}
* Print item icon
* @param $value
* @return string
public static function itemIcon($value)
$tag = $value['tag'];
if($value['tag'] === null)
$tag = 'i';
return '<' . $tag . ' class="' . $value['value'] . '"></' . $tag . '>';
* Print item new_tab option
* @param $newTab
* @return null|string
public static function new_tab($newTab)
if($newTab)
return 'target="_blank"';
return null;