Code Monkey home page Code Monkey logo

favicon's Introduction

Favicon Generator

This package allows you to build the most common favicons from a single PNG source file.

It can include :

  • MS favicons & tiles, manifest.json
  • old Apple favicons
  • Android favicons, browserconfig.xml
  • 64px icon
  • 48px icon

Basic usage

[PATH_TO_SOURCE_FILE] is the absolute path to your favicon source PNG file.

[DESTINATION_PATH] is the absolute path where you want the favicons to be stored (eg. the public directory of your website)

$config = array_merge([
  'filePath'      => '[PATH_TO_SOURCE_FILE]/favicon.png',
  'destPath'      => '[DESTINATION_PATH]/',
  'appName'       => 'Application name',
  'appShortName'  => 'AppName',
  'appLanguage'   => 'fr-FR',
  'appStartUrl'   => './?manifest=true',
  'appThemeColor' => '#F9F9F9',
  'appBgColor'    => '#F9F9F9',
  'appDisplay'    => 'standalone',
  'use64Icon'     => true,
  'use48Icon'     => true,
  'noOldApple'    => false,
  'noAndroid'     => false,
  'noMs'          => false,
], $testConfig);

$generator = new \JDZ\Favicon\Generator($config);

try {
  $generator->execute();
  
  // the info buffer stores the written files in an array
  $list_of_written_files = $generator->getInfoBuffer();
  echo "<pre>";
  print_r($list_of_written_files);
  echo "</pre>";
}
catch(\JDZ\Favicon\Exception\GeneratorException $e){
  echo $e->getMessage();
}

favicon's People

Contributors

joffreydemetz avatar

Stargazers

Gaëtan L. H.-F. avatar Floris avatar  Serreau Jovann avatar Nikolai Shcherbin avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

baureo gaetanlhf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.