That extension provide a way to create urls from your frontend part.
composer require dmirogin/yii2-js-urlmanager
'jsUrlManager' => [
'class' => \dmirogin\js\urlmanager\JsUrlManager::class,
],
'bootstrap' => ['jsUrlManager'],
UrlManager.createUrl('foo/bar', {id: 10})
if you want to change assets position, use this
'assetManager' => [
'bundles' => [
\dmirogin\js\urlmanager\JsUrlManagerAsset::class => [
'jsOptions' => [
'position' => \yii\web\View::POS_END,
],
],
],
],
Default value - \yii\web\View::POS_HEAD
The location to register configuration Frontend UrlManager string
'jsUrlManager' => [
'class' => \dmirogin\js\urlmanager\JsUrlManager::class,
'configurationStringPosition' => \yii\web\View::POS_END,
],
Default value - false
Setting configuration through document variable urlManagerConfiguration
'jsUrlManager' => [
'class' => \dmirogin\js\urlmanager\JsUrlManager::class,
'configureThroughVariable' => true,
],
npm run test
./vendor/bin/phpunit
npm run build
Comments