定制 dmamontov/favicon 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dmamontov/favicon

最新稳定版本:1.0.0

Composer 安装命令:

composer require dmamontov/favicon

包简介

Class generation favicon for browsers and devices Android, Apple, Windows and display of html code. It supports a large number of settings such as margins, color, compression, three different methods of crop and screen orientation.

README 文档

README

Latest Stable Version License Total Downloads PHP Classes

Favicon Generator

This class can create Favicon images for sites and mobile devices.

It takes a give base icon image and creates multiple versions of the image for use as favicon on Web sites or be displayed by mobile devices like those using systems of Apple, Microsoft, and Android.

The class can generate all the versions of the icon images with the different sizes, as well the necessary HTML to reference the icon images in a Web page.

The margins, color, compression, crop method and screen orientation are configurable parameters.

Requirements

  • PHP version ~5.3.3
  • Module installed Imagick

Installation

  1. Install composer

  2. Follow in the project folder:

composer require dmamontov/favicon ~1.0.0

In config composer.json your project will be added to the library dmamontov/favicon, who settled in the folder vendor/. In the absence of a config file or folder with vendors they will be created.

If before your project is not used composer, connect the startup file vendors. To do this, enter the code in the project:

require 'path/to/vendor/autoload.php';

Example of work

$fav = new FaviconGenerator(__DIR__ . '/tests.png');

$fav->setCompression(FaviconGenerator::COMPRESSION_VERYHIGH);

$fav->setConfig(array(
    'apple-background'    => FaviconGenerator::COLOR_BLUE,
    'apple-margin'        => 15,
    'android-background'  => FaviconGenerator::COLOR_GREEN,
    'android-margin'      => 15,
    'android-name'        => 'My app',
    'android-url'         => 'http://slobel.ru',
    'android-orientation' => FaviconGenerator::ANDROID_PORTRAIT,
    'ms-background'       => FaviconGenerator::COLOR_GREEN,
));

echo $fav->createAllAndGetHtml();

统计信息

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

GitHub 信息

  • Stars: 53
  • Watchers: 3
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-07-01