Skip to content

Commit cf3855f

Browse files
committed
added menu, simplified config
1 parent 62c099e commit cf3855f

File tree

2 files changed

+47
-29
lines changed

2 files changed

+47
-29
lines changed

src/MainMenu.php

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
/*
4+
* Hisite core package
5+
*
6+
* @link https://github.com/hiqdev/hisite-core
7+
* @package hisite-core
8+
* @license BSD-3-Clause
9+
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
10+
*/
11+
12+
namespace hiqdev\assetpackagist;
13+
14+
use Yii;
15+
16+
class MainMenu extends \hiqdev\menumanager\Menu
17+
{
18+
protected $_addTo = 'main';
19+
20+
public function items()
21+
{
22+
return [
23+
'about' => [
24+
'label' => Yii::t('hisite', 'About'),
25+
'url' => ['/site/about'],
26+
],
27+
'contact' => [
28+
'label' => Yii::t('hisite', 'Contact'),
29+
'url' => ['/site/contact'],
30+
],
31+
'github' => [
32+
'label' => 'GitHub',
33+
'url' => 'https://github.com/hiqdev/asset-packagist',
34+
],
35+
];
36+
}
37+
}

src/config/hisite.php

+10-29
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,22 @@
1212
return [
1313
'id' => 'asset-packagist',
1414
'name' => 'Asset Packagist',
15-
'basePath' => dirname(__DIR__),
16-
'vendorPath' => '<base-dir>/vendor',
17-
'runtimePath' => '<base-dir>/runtime',
15+
'viewPath' => '@hiqdev/assetpackagist/views',
1816
'controllerNamespace' => 'hiqdev\assetpackagist\controllers',
1917
'bootstrap' => ['log'],
2018
'components' => [
21-
'log' => [
22-
'traceLevel' => 0,
23-
'targets' => [
24-
'default' => [
25-
'class' => 'yii\log\FileTarget',
26-
'levels' => ['error', 'warning'],
27-
],
28-
],
29-
],
30-
'cache' => [
31-
'class' => 'yii\\caching\\FileCache',
32-
],
33-
'request' => [
34-
'cookieValidationKey' => $params['cookieValidationKey'],
19+
'packageStorage' => [
20+
'class' => \hiqdev\assetpackagist\components\Storage::class,
3521
],
36-
'view' => [
37-
'theme' => [
38-
'pathMap' => [
39-
'@hiqdev/assetpackagist/views' => '@hisite/views',
40-
],
22+
'menuManager' => [
23+
'menus' => [
24+
'main' => \hiqdev\assetpackagist\MainMenu::class,
4125
],
4226
],
43-
'urlManager' => [
44-
'enablePrettyUrl' => true,
45-
'showScriptName' => false,
46-
],
47-
'packageStorage' => [
48-
'class' => \hiqdev\assetpackagist\components\Storage::class,
27+
'themeManager' => [
28+
'pathDirs' => [
29+
'assetpackagist' => '@hiqdev/assetpackagist',
30+
],
4931
],
5032
],
51-
'modules' => [],
5233
];

0 commit comments

Comments
 (0)