oxy-coach/yii2-slug-generator-widget

Slug generating widget working with yii2 seo behavior

v1.0.0 2018-08-27 12:45 UTC

This package is not auto-updated.

Last update: 2024-05-12 04:09:23 UTC


README

Slug generating widget working with SeoBehavior for creating slug string on-fly using js.

Installation via Composer

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.

Configuring

Add action in the controller, for example:

use oxycoach\slugwidget\SlugGeneratorAction;

\\ ...

    public function actions()
    {
        return [
            'slug-generate' => [
                'class' => SlugGeneratorAction::class,
            ],
        ];
    }

Usage

use oxycoach\slugwidget\SlugGeneratorWidget;

\\ ...

    <?= SlugGeneratorWidget::widget([
        'form' => $form,
        'model' => $model,
        'slugGenerationAction' => ['slug-generate']
    ]); ?>

Configure slugGenerationAction property for different slug generating url route