infoweb-internet-solutions/yii2-cms-sliders

Yii2的滑块模块

2.0.1 2016-02-25 12:29 UTC

This package is not auto-updated.

Last update: 2024-09-28 16:36:17 UTC


README

文档

安装

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

运行以下命令

php composer.phar require --prefer-dist infoweb-internet-solutions/yii2-cms-sliders "*"

或添加

"infoweb-internet-solutions/yii2-cms-sliders": "*"

到你的composer.json文件的require部分。

一旦扩展安装完成,只需按照以下方式修改你的common配置

return [
    ...
    'modules' => [
        ...
        'yii2images' => [
            'class' => 'rico\yii2images\Module',
            // @frontend/web/
            'imagesStorePath' => '@uploadsBaseUrl/img/store', //path to origin images
            'imagesCachePath' => '@uploadsBaseUrl/img/cache', //path to resized copies
            'graphicsLibrary' => 'GD', //but really its better to use 'Imagick'
            'placeHolderPath' => '@infoweb/sliders/assets/img/placeHolder.png',
        ],
    ],
];

运行此迁移

yii migrate/up --migrationPath=@infoweb/sliders/migrations

导入翻译

yii i18n/import @infoweb/sliders/messages

添加到backend/config/main.php

'modules' => [
	...
	'sliders' => [
    	'class' => 'infoweb\sliders\Module',
	],
	...
	'cms' => [
		...
		'sideBarItems'  => [
			'modules'   => [
				...
				[
					'label'     => 'Sliders',
					'i18nGroup' => 'infoweb/sliders',
					'url'       => '/sliders/slider/index',
					'authItem'  => 'showSlidersModule',
					'activeUrl' => 'sliders',
				],
			],
		],
	],
	...
],

配置

以下列出了所有可用配置选项及其默认值。

defaultWith (类型: integer, 默认: 800)

新滑块的默认宽度(以像素为单位)。

defaultHeight (类型: integer, 默认: 200)

新滑块的默认高度(以像素为单位)。

enableImageTitle (类型: boolean, 默认: false)

如果此选项设置为true,则可以为滑块中的每张图片设置标题。

enableImageSubTitle (类型: boolean, 默认: false)

如果此选项设置为true,则可以为滑块中的每张图片设置副标题。

enableImageDescription (类型: boolean, 默认: false)

如果此选项设置为true,则可以为滑块中的每张图片设置描述。

enableImageUrl (类型: boolean, 默认: false)

如果此选项设置为true,则可以为滑块中的每张图片设置URL。

enableTextPosition (类型: boolean, 默认: false)

如果此选项设置为true,则可以为滑块中每张图片的文字设置位置。