Skip to content

Commit

Permalink
fixed namespaces in menus
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Sep 29, 2016
1 parent 8bbad67 commit ca68945
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/config/hisite.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
],
'themeManager' => [
'pathMap' => [
'@hisite/views' => '$themedViewPaths',
'$themedViewPaths' => ['@hisite/views'],
],
],
Expand Down
3 changes: 1 addition & 2 deletions src/menus/FooterMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
*/

namespace hisite;
namespace hisite\menus;

class FooterMenu extends MainMenu
{
protected $_addTo = 'footer';
}
12 changes: 5 additions & 7 deletions src/menus/MainMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
*/

namespace hisite;
namespace hisite\menus;

use Yii;

class MainMenu extends \hiqdev\menumanager\Menu
{
protected $_addTo = 'main';

public function items()
{
$login = Yii::$app->user->isGuest ? 'login' : 'logout';
$logOp = Yii::$app->user->isGuest ? 'login' : 'logout';

return [
'home' => [
Expand All @@ -34,9 +32,9 @@ public function items()
'label' => Yii::t('hisite', 'Contact'),
'url' => ['/site/contact'],
],
'login' => [
'label' => Yii::t('hisite', ucfirst($login)),
'url' => ['/site/' . $login],
$logOp => [
'label' => Yii::t('hisite', ucfirst($logOp)),
'url' => ['/site/' . $logOp],
],
];
}
Expand Down

0 comments on commit ca68945

Please sign in to comment.