Slug generating widget working with SeoBehavior for creating slug string on-fly using js.
Run the following command
$ composer require oxy-coach/yii2-slug-generator-widget "*"
or add
$ "oxy-coach/yii2-slug-generator-widget": "*"
to the require section of your composer.json
file.
Add action in the controller, for example:
use oxycoach\slugwidget\SlugGeneratorAction;
\\ ...
public function actions()
{
return [
'slug-generate' => [
'class' => SlugGeneratorAction::class,
],
];
}
use oxycoach\slugwidget\SlugGeneratorWidget;
\\ ...
<?= SlugGeneratorWidget::widget([
'form' => $form,
'model' => $model,
'slugGenerationAction' => ['slug-generate']
]); ?>
Configure slugGenerationAction
property for different slug generating url route