forked from nWidart/laravel-menus
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kashif Ullah
committed
Aug 24, 2017
1 parent
71a5fb4
commit 0a7d188
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
namespace Nwidart\Menus\Presenters\Foundation; | ||
|
||
use Nwidart\Menus\Presenters\Presenter; | ||
|
||
class ZurbMenuPresenter extends Presenter | ||
{ | ||
/** | ||
* {@inheritdoc } | ||
*/ | ||
public function getOpenTagWrapper() | ||
{ | ||
return PHP_EOL . '<nav class="custom-main"> | ||
<ul class="dropdown menu" data-dropdown-menu>' . PHP_EOL; | ||
} | ||
|
||
/** | ||
* {@inheritdoc } | ||
*/ | ||
public function getCloseTagWrapper() | ||
{ | ||
return PHP_EOL . '</ul></nav>' . PHP_EOL; | ||
} | ||
|
||
/** | ||
* {@inheritdoc } | ||
*/ | ||
public function getMenuWithoutDropdownWrapper($item) | ||
{ | ||
return '<li'.$this->getActiveState($item).'><a href="'. $item->getUrl() .'">'.$item->title.'</a></li>'; | ||
} | ||
|
||
/** | ||
* {@inheritdoc } | ||
*/ | ||
public function getActiveState($item) | ||
{ | ||
return \Request::is($item->getRequest()) ? ' class="is-active"' : null; | ||
} | ||
|
||
/** | ||
* {@inheritdoc } | ||
*/ | ||
public function getDividerWrapper() | ||
{ | ||
return '<li class="divider"></li>'; | ||
} | ||
|
||
/** | ||
* {@inheritdoc } | ||
*/ | ||
public function getMenuWithDropDownWrapper($item) | ||
{ | ||
return '<li class="dropdown dropdown-primary"> | ||
<a class="dropdown-toggle" href="#">'.$item->title.'</a> | ||
<ul class="menu"> | ||
'.$this->getChildMenuItems($item).' | ||
</ul> | ||
</li>' . PHP_EOL; | ||
} | ||
|
||
|
||
/** | ||
* {@inheritdoc } | ||
*/ | ||
public function getMultiLevelDropdownWrapper($item) | ||
{ | ||
return '<li> | ||
<a href="#">'.$item->title . '</a> | ||
<ul class="menu"> | ||
' . $this->getChildMenuItems($item) . ' | ||
</ul> | ||
</li>'. PHP_EOL; | ||
} | ||
} |