edgarez / faviconbundle
1.0.4
2017-01-03 15:12 UTC
Requires
- php: >=5.3.3
- guzzle/guzzle: ~3.9@dev
README
将RealFaviconGenerator的多平台favicon生成器集成到您的eZPlatform应用程序中。受joaoalves89的RealFaviconGeneratorBundle (https://github.com/joaoalves89/RealFaviconGeneratorBundle/tree/master)启发
安装
使用Composer获取Bundle
从eZPlatform项目的根目录终端运行以下命令以添加EdgarEzFaviconBundle
composer require edgarez/faviconbundle
启用Bundle
要开始使用Bundle,请在应用程序的kernel类中注册Bundle
// ezpublish/EzPublishKernel.php public function registerBundles() { $bundles = array( // ... new EdgarEz\FaviconBundle\EdgarEzFaviconBundle(), // ... ); }
配置Bundle
# ezpublish/config/config.yml edgar_ez_favicon: system: acme_group: #for each siteaccess api_key: ... #required master_picture: @AcmeBundle/Resources/public/images/acme/photo.jpg #required package_dest: @AcmeBundle/Resources/public/images/acme/favicons/ #required favicons_view: @AcmeBundle/Resources/views/acme/favicons.html.twig #required versioning: true favicon_design: desktop_browser: [] ios: picture_aspect: "background_and_margin" margin: 0 background_color: "#fff" windows: picture_aspect: "white_silhouette" background_color: "#fff" firefox_app: picture_aspect: "circle" keep_picture_in_circle: true circle_inner_margin: 5 background_color: "#fff" manifest: app_name: "bar" app_description: "bar description" android_chrome: picture_aspect: "shadow" theme_color: "#fff" manifest: name: "bar" display: "standalone" orientation: "portrait" safari_pinned_tab: picture_aspect: "black_and_white" threshold: 60 theme_color: "#fff" coast: picture_aspect: "background_and_margin" background_color: "#fff" margin: 4 open_graph: picture_aspect: "background_and_margin" background_color: "#fff" margin: 4 ratio: "1.91:1" yandex_browser: background_color: "#fff" manifest: show_title: true version: "1.0" acme: #or/and especially for acme siteaccess # ... same as before
- api_key:访问RealFaviconGenerator网站以获取非交互式模式的自己的API密钥
- master_picture:定义用于生成favicon的图像模型路径
- package_dest:定义favicon图像将被上传的位置
- favicons_view:定义哪个twig模板将被用来完成所有head链接的favicon
- versioning:定义是否在favicon路径后添加GET参数
- favicon_design:所有参数尚未实现,请参阅文档(http://realfavicongenerator.net/api/non_interactive_api#.VhrCqnrtlBc)
如何使用
// generate favicons for global configuration (acme_group) php ezpublish/console edgar_ez:favicon // generate favicons only for acme siteaccess php ezpublish/console edgar_ez:favicon --siteaccess=demo // install favicons uploaded in your AcmeBundle php ezpublish/console asset:install