izica/phalcon-meta-tags
Composer 安装命令:
composer require izica/phalcon-meta-tags
包简介
Phalcon PHP Meta tags service
README 文档
README
Phalcon meta tags plugin for PhalconPHP.
This plugin allows you to easily and flexibly customize the meta tags of your view.
If this plugin helped you, be glad to see your star, thank you.
Check out new validation package for PhalconPHP https://github.com/izica/phalcon-validation
Install
composer require izica/phalcon-meta-tags
Plugin functions
setTitle($title) getTitle() setByProperty($property, $content) unsetByProperty($properties) //array or single property name setByName($name, $content) unsetByName($properties) //array or single name setCustom($key, $attributes) //unique key and attributes array unsetCustom($keys) //array or single value getMeta() // return metas string
Usage:
Register plugin as service:
$di = new DI(); $di->set('metatag', function() { return new IzicaMetaTags(); });
Add data to your layout:
<!DOCTYPE html> <html> <head> <?php echo $this->metatag->getTitle();?> <?php echo $this->metatag->getMeta();?> </head> <body> <?php echo $this->getContent(); ?> </body> </html>
Use service in controller, view or middleware(anywhere):
use Phalcon\Mvc\Controller; class IndexController extends Controller { public function indexAction() { $this->metatag->setTitle("Phalcon MetaTags Service"); $this->metatag->setCustom("charset", ['charset' => 'UTF-8']); $this->metatag->setCustom("http", ['http-equiv' => 'content-type', 'content' => 'text/html; charset=UTF-8']); $this->metatag->setByName("description", "phalcon php metatags"); $this->metatag->setByProperty("og:description", "When Great Minds Don’t Think Alike"); } }
Example of output:
<title>Phalcon MetaTags Service</title> <meta name="description" content="phalcon php metatags"> <meta property="og:description" content="When Great Minds Don’t Think Alike"> <meta charset="UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
izica/phalcon-meta-tags 适用场景与选型建议
izica/phalcon-meta-tags 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16.31k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2017 年 01 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「tags」 「meta」 「metatags」 「phalcon」 「meta-tags」 「phalconphp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 izica/phalcon-meta-tags 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 izica/phalcon-meta-tags 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 izica/phalcon-meta-tags 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A powerfull cacher based on laravels file cache driver
Harvest statistics and meta data from an URL or his source code (seo oriented).
A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content (forked from Cyber-Duck/Silverstripe-SEO)
SEO Tools for Laravel and Lumen
Help to manage meta data on Laravel Eloquent model
A simple, repeatable field type
统计信息
- 总下载量: 16.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-11