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

1.0.0 2014-11-12 15:39 UTC

This package is not auto-updated.

Last update: 2024-09-24 16:08:02 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'];