承接 prokhonenkov/yii2-banners-system 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

prokhonenkov/yii2-banners-system

Composer 安装命令:

composer require prokhonenkov/yii2-banners-system

包简介

The system of banners

README 文档

README

This extension helps to place banners on pages of a site and manage them.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require prokhonenkov/yii2-banners-system

or add

"prokhonenkov/yii2-banners-system": "*"

to the require section of your composer.json file.

Migrations

Run the following command

php yii migrate --migrationPath=@prokhonenkov/bannerssystem/migrations --interactive=0

Configuration

Add module declaration to your config file for web config:

<?php

return [
    // ... your config
    'modules' => [
        'bannersSystem' => [
            'class' => \prokhonenkov\bannerssystem\BannersSystem::class,
            'administratorPermissionName' => 'admin', //admin role
            'uploadDir' => '@webroot/media/banners-system',
            'uploadUrl' => '@web/media/banners-system',
        ],
    ],
    'bootstrap' => [        
        'bannersSystem' // add module id to bootstrap for proper aliases and url routes binding
    ]
];

Also, you can override layout and view files:

<?php

return [
    // ... your config
    'modules' => [
        'bannersSystem' => [
            'class' => \prokhonenkov\bannerssystem\BannersSystem::class,
            'administratorPermissionName' => 'admin', //admin role
            'uploadDir' => '@webroot/media/banners-system',
            'uploadUrl' => '@web/media/banners-system',
            
            'layout' => '@alias/views/layouts/main',
            'views' => [
                'banner' => [
                    'index' => '@path/index',
                    'update' => '@path/update',
                    'create' => '@path/create',
                    'view' => '@path/view',
                ],
                'area' => [
                    'index' => '@path/index',
                    'update' => '@path/update',
                    'create' => '@path/create',
                    'view' => '@path/view',
                ]
            ],
        ],
    ],
];

Usage

Put this code in your desired controller:

public function behaviors()
{
    return [
        'banner-system' => [
            'class' => \prokhonenkov\bannerssystem\behaviors\BannerSystemBehavior::class
        ]
    ];
}

Then, create a banner zone and banner in the admin panel.

Put this code in your desired view file in the desired place:

<?= \prokhonenkov\bannerssystem\BannerZone::getInstance()->setZoneById(BANNER_ZONE_ID);?>

统计信息

  • 总下载量: 101
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2019-03-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固