frenzelgmbh / sblog

yii2 的智能 Weblog 模块

安装: 81

依赖者: 0

建议者: 0

安全性: 0

星星: 1

关注者: 4

分支: 0

类型:yii2-extension

dev-master 2015-12-13 18:05 UTC

This package is not auto-updated.

Last update: 2024-09-10 06:53:33 UTC


README

SMART WebLog 模块

安装

使用 composer 安装包 "frenzelgmbh/sblog": "dev-master"

更新配置文件 config/web.phpconfig/db.php

// app/config/web.php
return [
    'modules' => [
        'sblog' => [
            'class' => 'frenzelgmbh\sblog\Module',
            // set custom module properties here ...
        ],
    ],
];
// app/config/db.php
return [
        'class' => 'yii\db\Connection',
        // set up db info
];

运行迁移文件 php yii migrate --migrationPath=@vendor/frenzelgmbh/sblog/migrations

小部件

要使用博客,您可以实现以下小部件

图片链接小部件(可以用于包含广告链接)

  • 模块(例如 STARTPAGE)
  • ID(1)
  • 图片(需要上传)
  • 链接(您想链接到的任何内容)
if(class_exists('frenzelgmbh\sblog\widgets\WidgetPictureLink')){
  echo frenzelgmbh\sblog\widgets\WidgetPictureLink::widget([
    'title'=>NULL,
    'limit'=>20,
  ]); 
}

此小部件按创建日期降序渲染所有帖子。

if(class_exists('frenzelgmbh\sblog\widgets\PortletPostsStyled')){
  echo frenzelgmbh\sblog\widgets\PortletPostsStyled::widget([
  'title'=>NULL,
    'limit'=>4,
  ]); 
}