Download the PHP package lyrasoft/banner without Composer

On this page you can find all versions of the php package lyrasoft/banner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package banner

LYRASOFT Banner Package

screenshot

Installation

Install from composer

Then copy files to project

Seeders

Languages

If you don't want to copy language files, remove -t lang from install command.

Then add this line to admin & front middleware:

Use Type or Category

You have 2 choice to structure banners, use type or category

Type:

screenshot 2022-08-27 下午4 51 25

Category:

screenshot 2022-08-27 下午4 52 04

The default will use category mode. If you want to use type mode, you must create a BannerType enum, for example:

Then register enum class to config file:

The package will auto switch to type mode.

Register Admin Menu

Edit resources/menu/admin/sidemenu.menu.php

Ues Type mode:

Use Category mode:

Add Widget

Add this to packages/widget.php

Install Swiper and youtube-background

After packages installed, it will auto reauire swiper as node modules for root package.json.

If you needs use video & Youtbue, you must manually install youtube-background

Frontend Usage

Use BannerRepository to get banners

Then use component in Edge:

2022-08-01 19 05 58

You can add some params:

Parameters

Param Name Type Default Description
banners Banner[] null The banner items, must be a iterable with Banner entity.
category-alias ?string null If not provides banner items, component will find banners by this condition.
category-id string or int null If not provides banner items, component will find banners by this condition.
type string _default If not provides banner items, use this type name to find banners & size & ratio settings.
link-target string null The link target, can be _blank
height string null Force banner height, ignore ratio settings.
ratio float null The widrh / height ratio. for example: 16:9 is 1.7778. Leave empty yto let component calc it.
show-text bool false Show banner title / description or not.
options array [] The options for Swiper

Examples

Load by type

Load by category alias

Load by category ID

Banner Item Slot

Use item slot with @scope(), you will get Banner entity and index $i.

Then just build you own HTML.

Use Banner Item Component

Use can use x-banner-item component, it;s includes default RWD and video switch functions.

Parameters:

Param Name Type Default Description
type string _default Use this type name to find size & ratio settings.
banner Banner null The banner item, must be a Banner entity.
link-target string null The link target, can be _blank
height string null Force banner height, ignore ratio settings.
ratio float null The widrh / height ratio. for example: 16:9 is 1.7778. Leave empty yto let component calc it.
show-text bool false Show banner title / description or not.

The Size Settings.

Open etc/packages/banner.php, you will see:

The _default type has 2 sizes settings, desktop and mobile, this means admin upload images will use this size:

screenshot 2022-08-01 下午7 23 22

You can change all uploading settings here.

Custom Size for Type or Category Alias

If you have a category with alias (promote), you can add a promote size settings with different size.

Make sure your category alias is same:

screenshot 2022-08-01 下午7 28 59

Then the banners in this category will use the new size:

screenshot 2022-08-01 下午7 27 55

Create Default Categories/Type

If you use Category mode, you may want to create some default categories in migration:

If you use Type mode, just change the BannerType enum cases:

BannerScript

Directly use Swiper or Youtube Background

Widget

If you ever added BannerWidget::class to widget.php, you'll see this widget in admin:

screenshot 2022-08-01 下午7 31 59

After you added this widget and save. Use this code to render position, for example (demo position):


All versions of banner with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
lyrasoft/luna Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lyrasoft/banner contains the following files

Loading the files please wait ....