mark-de-froze/yii2-uikit

Uikit 3 for Yii2

安装: 46

依赖者: 0

建议者: 0

安全性: 0

星级: 0

关注者: 0

分支: 8

开放问题: 0

类型:yii2-extension

1.3.5 2017-03-23 13:06 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:01:39 UTC


README

为轻量级和模块化前端框架UiKit提供的组件和资源

安装Yii2 Uikit扩展

安装此扩展的首选方式是通过composer。只需运行

php composer.phar require --prefer-dist ilyaplot/yii2-uikit

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

"ilyaplot/yii2-uikit": "*"

使用示例

例如,在任意视图文件中包含主要的UiKit css和js文件

\worstinme\uikit\UikitAsset::register($this);

Uikit幻灯片组件示例

  • 从webroot路径渲染包含图片的幻灯片
<?= \worstinme\uikit\widgets\Slideshow::widget(['path' => '/images/somefolder/']) ?>
  • 使用自定义幻灯片渲染幻灯片
<?= \worstinme\uikit\widgets\Slideshow::widget(['slides' => [
		'<div class="slide">Any content with some <a href="#">button</a> e.g.</div>'
		'<div class="pam_pam_slide-two">Another content with some <a href="#">button</a> e.g.</div>'
	]
]); ?>
  • 带有叠加层的幻灯片渲染
<?= \worstinme\uikit\widgets\Slideshow::widget(['items' => [
		['img'=>'/link/to/img.jpg','overlay'=>'Any content with some <a href="#">button</a> e.g.'],
		['img'=>'/link/to/img.jpg','overlay'=>'Any content with some <a href="#">button</a> e.g.'],
	]
]); ?>