arrounded/metadata 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

arrounded/metadata

最新稳定版本:1.0.1

Composer 安装命令:

composer require arrounded/metadata

包简介

The description of the module

关键字:

README 文档

README

Build Status Latest Stable Version Total Downloads Scrutinizer Quality Score Code Coverage

Install

Via Composer

$ composer require arrounded/metadata

Usage

First add the module's service provider and facade to config/app.php:

Arrounded\Metadata\ServiceProvider::class,
'Metadata' => Arrounded\Metadata\Facades\Metadata::class,

Then somewhere in your service provider, define your application's metadata. Either by passing it an array:

$this->app['arrounded.metadata']->setMetadata([
    ['url' => 'foo.com', 'title' => Homepage', 'description' => 'foobar'],
]);

Or by indicating it the path to a CSV file:

metadata.csv

url,title,description
foo.com,Homepage,foobar
$this->app['arrounded.metadata']->setMetadataFromFile('metadata.csv');

Then in your views call the render method on the facade. It'll look at the current URL and find the correct metadata for the page. You can also pass it an array of additional metadata:

{{ Metadata.render() }}
{{ Metadata.render({image: 'foo.com/logo.png'}) }}

By default all properties (except core ones such as title, description etc) are also wrapped in Twitter/Facebook graph metadata. You can disable this behavior by setting which properties should not be wrapped:

$this->app['arrounded.metadata']->setMetadataFromFile('metadata.csv');
$this->app['arrounded.metadata']->setUnwrapped(['property', 'other_property']);

Testing

$ composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固