heggi/yii2-slugwidget

自动生成slug的小部件

安装次数: 45

依赖: 1

建议者: 0

安全: 0

星标: 1

关注者: 0

分支: 0

开放问题: 0

类型:yii2-extension

v0.1.0.1 2017-07-06 15:34 UTC

This package is not auto-updated.

Last update: 2024-09-24 18:21:54 UTC


README

自动生成slug的小部件

安装

安装此扩展的首选方式是通过 composer

可以运行

php composer.phar require --prefer-dist heggi/yii2-slugwidget "*"

或者将以下内容添加到你的 composer.json 文件的 require 部分:

"heggi/yii2-slugwidget": "*"

to the require section of your composer.json file.

使用方法

扩展安装完成后,只需在你的代码中使用它即可

<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'slug')->widget(\heggi\slugwidget\SlugWidget::className(), ['title' => 'title']) ?>