{"id":16317397,"url":"https://github.com/sdkiller/zyx-widget-imagex","last_synced_at":"2025-07-26T21:09:55.807Z","repository":{"id":16771672,"uuid":"19529779","full_name":"SDKiller/zyx-widget-imagex","owner":"SDKiller","description":"OpenGraph meta tags and Schema.org markdown for images","archived":false,"fork":false,"pushed_at":"2014-06-26T01:16:48.000Z","size":189,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T20:19:26.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dreamfactorysoftware/.net-sdk","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SDKiller.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-07T10:08:53.000Z","updated_at":"2014-06-26T01:12:13.000Z","dependencies_parsed_at":"2022-07-25T05:46:06.551Z","dependency_job_id":null,"html_url":"https://github.com/SDKiller/zyx-widget-imagex","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDKiller%2Fzyx-widget-imagex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDKiller%2Fzyx-widget-imagex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDKiller%2Fzyx-widget-imagex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDKiller%2Fzyx-widget-imagex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SDKiller","download_url":"https://codeload.github.com/SDKiller/zyx-widget-imagex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253982078,"owners_count":21994386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T22:08:20.463Z","updated_at":"2025-05-13T16:32:58.892Z","avatar_url":"https://github.com/SDKiller.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"ImageX\n=======\n\n[![Latest Stable Version](https://poser.pugx.org/zyx/widget-imagex/v/stable.png)](https://packagist.org/packages/zyx/widget-imagex)\n[![Latest Unstable Version](https://poser.pugx.org/zyx/widget-imagex/v/unstable.png)](https://packagist.org/packages/zyx/widget-imagex)\n[![Total Downloads](https://poser.pugx.org/zyx/widget-imagex/downloads.png)](https://packagist.org/packages/zyx/widget-imagex)\n[![License](https://poser.pugx.org/zyx/widget-imagex/license.png)](https://packagist.org/packages/zyx/widget-imagex)\n[![Code Climate](https://codeclimate.com/github/SDKiller/zyx-widget-imagex.png)](https://codeclimate.com/github/SDKiller/zyx-widget-imagex)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/SDKiller/zyx-widget-imagex/badges/quality-score.png)](https://scrutinizer-ci.com/g/SDKiller/zyx-widget-imagex/)\n\n\n\nWidget for simple generating OpenGraph meta tags and Schema.org markdown for images\n_('X' stands for 'eXtended')_.\n\nYou may do absolutely nothing - OpenGraph meta tags and Schema.org markdown will be generated 'on-the-fly' from image properties (which you can still define like you do in ```Html::img()```).\n\n\nREQUIREMENTS\n------------\n\nYou should generally follow [Yii 2 requirements](https://github.com/yiisoft/yii2/blob/master/README.md).\nThe minimum is that your Web server supports PHP 5.4.0.\n\n\nINSTALLATION\n------------\n\n### Install via Composer\n\nIf you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions\nat [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist zyx/widget-imagex \"*\"\n```\n\nor add\n\n```\n\"zyx/widget-imagex\": \"*\"\n```\n\nto the require section of your composer.json.\n\n\nUSAGE\n-----\n\n\nJust add following string to your layout\n\n```\nuse zyx\\widgets\\ImageX;\n```\n\nAnd call widget where the image is supposed to be instead of usual ```Html::img()```:\n\n```\necho ImageX::widget([\n                  'src' =\u003e 'http://static.yiiframework.com/css/img/logo.png',\n                  'options' =\u003e ['width' =\u003e 280, 'height' =\u003e 60],\n                  'og' =\u003e [],\n                  'md' =\u003e ['div_class' =\u003e 'image_wrap']\n                ]);\n\n```\n\n**Note:** only 'src' parameter is mandatory. Array of 'options' is the same you use for image options in ```Html::img()```. If both 'og' (OpenGraph) and 'md' (schema.org) configuration arrays are empty - you may not declare them at all. You can to disable one of them (they are both enabled by default) - e.g. ```'md' =\u003e ['enable' =\u003e false]```.\n\n\nSo, the result of example above should be something like this:\n--------------------------------------------------------------\n\nIn the HEAD:\n\n```\n...\n  \u003cmeta property=\"og:image\" content=\"http://static.yiiframework.com/css/img/logo.png\"\u003e\n  \u003cmeta property=\"og:image:type\" content=\"image/png\"\u003e\n  \u003cmeta property=\"og:image:width\" content=\"280\"\u003e\n  \u003cmeta property=\"og:image:height\" content=\"60\"\u003e\n...\n\n```\n\nIn the BODY ('img' is wrapped in 'div' tag):\n\n```\n...\n\u003cdiv itemscope itemtype=\"http://schema.org/ImageObject\" class=\"image_wrap\"\u003e\n  \u003cimg src=\"http://static.yiiframework.com/css/img/logo.png\" width=\"280\" height=\"60\" alt=\"\" itemprop=\"contentUrl\" /\u003e\n\t\u003cmeta itemprop=\"width\" content=\"280\" /\u003e\n\t\u003cmeta itemprop=\"height\" content=\"60\" /\u003e\n\u003c/div\u003e\n...\n\n```\n\nProperties like 'width' and 'height' set explicitly in 'og' and 'md' configuration arrays, passed to widget, have priority.\nIf no such options were set, widget attempts to extract properties from image 'options' array.\n\nSo you can just call:\n\n```\necho ImageX::widget([\n                  'src' =\u003e 'http://static.yiiframework.com/css/img/logo.png',\n                  'options' =\u003e ['width' =\u003e 280, 'height' =\u003e 60]\n                ]);\n\n```\n\nlike you called ```Html::img()``` with no additional options.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdkiller%2Fzyx-widget-imagex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdkiller%2Fzyx-widget-imagex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdkiller%2Fzyx-widget-imagex/lists"}