{"id":22640675,"url":"https://github.com/beastbytes/yii2-microformats","last_synced_at":"2025-08-08T02:21:16.810Z","repository":{"id":62492602,"uuid":"39702368","full_name":"beastbytes/yii2-microformats","owner":"beastbytes","description":"Yii2 Widget to generate microformats2 from model data","archived":false,"fork":false,"pushed_at":"2015-08-05T11:56:52.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T15:55:01.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beastbytes.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":"2015-07-25T20:46:09.000Z","updated_at":"2015-07-26T13:10:21.000Z","dependencies_parsed_at":"2022-11-02T09:30:51.634Z","dependency_job_id":null,"html_url":"https://github.com/beastbytes/yii2-microformats","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/beastbytes%2Fyii2-microformats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beastbytes%2Fyii2-microformats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beastbytes%2Fyii2-microformats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beastbytes%2Fyii2-microformats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beastbytes","download_url":"https://codeload.github.com/beastbytes/yii2-microformats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246143315,"owners_count":20730240,"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-12-09T04:13:04.556Z","updated_at":"2025-03-29T05:25:44.615Z","avatar_url":"https://github.com/beastbytes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microformats2 Generator for Yii2\n\nThis extension is a Yii2 Widget to generate microformats from model data; also included is a Formatter class for formatting of WGS84 coordinates.\n\nFor license information check the [LICENSE](LICENSE.md)-file.\n\n## Installation\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist beastbytes/yii2-microformats\n```\n\nor add\n\n```json\n\"beastbytes/yii2-microformats\": \"~1.0.0\"\n```\n\nto the require section of your composer.json.\n\n\n## Usage\n\nUse this extension in a view in a similar way to [yii\\widgets\\DetailView](http://www.yiiframework.com/doc-2.0/yii-widgets-detailview.html) (it's a child class of DetailView).\n\nLet's generate an \"h-card\" from a user model - $user - that has the following relations:\n\n* profile - that stores the user's name\n* address - for the user's address\n* phone - for the user's phone number\n\nIn the view:\n\n```php\necho Microformat::widget([\n    'microformat' =\u003e 'h-card', // name of the microformat\n    'model' =\u003e $user, // the model that provides the data\n    'attributes' =\u003e [ / the attributes array specifies the microformat properties\n        'p-name:profile.name', // get the user's name from the profile relation\n        'p-email',\n        'p-tel:phone.value',        \n        [ // Additional markup that is not a microformat property\n            'value' =\u003e 'Address',\n            'template' =\u003e '\u003cdiv class=\"h-card__title\"\u003e{value}\u003c/div\u003e' // with it's own template\n        ],\n        [\n            'property' =\u003e 'p-adr',\n            'microformat' =\u003e 'h-adr, // Markup the address with an embedded h-adr microformat\n            'model' =\u003e $user-\u003eaddress, // we can specify a new model for embedded microformats; if not given the parent microformat model is used\n            'template' =\u003e '\u003cdiv {options}\u003e{value}\u003c/div\u003e', // a new template for h-adr\n            'attributes' =\u003e [\n                'p-street-address', // fetch data from $user-\u003eaddress-\u003estreet_address\n                'p-locality',\n                'p-region',\n                'p-postal-code',\n                [\n                    'property' =\u003e 'p-geo',\n                    'microformat' =\u003e 'h-geo',\n                    'template' =\u003e '\u003cdiv\u003e\u003cspan\u003e{label}\u003c/span\u003e\u003cdata {options} value=\"{rawValue}\"\u003e{value}\u003c/data\u003e\u003c/div\u003e',\n                    'formatter' =\u003e [ // use the included formatter for latitude and longitude\n                        'class' =\u003e '\\\\beastbytes\\\\microformats\\\\Formatter',\n                        'coordinateFormat' =\u003e '%02d %02.6f h'\n                    ],\n                    'attributes' =\u003e [\n                        'property' =\u003e 'p-latitude:latitude:latitude', // microformat property:model attribte:format\n                        'property' =\u003e 'p-longitude:longitude:longitude'\n                    ]\n                ]\n            ]            \n        ]\n    ]\n]);\n```\n\nSee the source code for more configuration details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeastbytes%2Fyii2-microformats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeastbytes%2Fyii2-microformats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeastbytes%2Fyii2-microformats/lists"}