mithun12000 / yii2-urlasset
Url Asset for Yii2 just like AssetBundle except it will work for creating menu for site module dynamically.
Installs: 644
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Type:yii2-extension
Requires
- yiisoft/yii2: >= 2.0.0
This package is not auto-updated.
Last update: 2024-11-05 16:45:21 UTC
README
Url Asset for Yii2 just like AssetBundle except it will work for creating menu for site module dynamically.
Installation
Using composer
"require": {
...other dependency...
"mithun12000/yii2-urlasset":"*"
},
Add as extension. Code:
'UrlAsset' => [ 'name' => 'UrlAsset', 'version' => '1.0', 'alias' => [ '@yii/UrlAsset/' => [EXTENSION_PATH] '/UrlAsset', ], ],
Configure
In Layout / view file.
use Yii\UrlAsset\component\UrlAsset;
$urls = new UrlAsset(['assetFile'=>'AppUrlAsset']); //default file for search is AppUrlAsset.php with namespace can be configurable.
$urls->registerAll($this);
$urls->setParams($this);
//to get all menu item.
$menuitems = $this->params['urls'];