PHPackages                             beastbytes/yii2-microformats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. beastbytes/yii2-microformats

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

beastbytes/yii2-microformats
============================

Yii2 Widget to generate microformats2 from model data

v1.0.0(10y ago)048BSD-3-ClausePHP

Since Jul 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/beastbytes/yii2-microformats)[ Packagist](https://packagist.org/packages/beastbytes/yii2-microformats)[ RSS](/packages/beastbytes-yii2-microformats/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Microformats2 Generator for Yii2
================================

[](#microformats2-generator-for-yii2)

This extension is a Yii2 Widget to generate microformats from model data; also included is a Formatter class for formatting of WGS84 coordinates.

For license information check the [LICENSE](LICENSE.md)-file.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist beastbytes/yii2-microformats

```

or add

```
"beastbytes/yii2-microformats": "~1.0.0"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

Use 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).

Let's generate an "h-card" from a user model - $user - that has the following relations:

- profile - that stores the user's name
- address - for the user's address
- phone - for the user's phone number

In the view:

```
echo Microformat::widget([
    'microformat' => 'h-card', // name of the microformat
    'model' => $user, // the model that provides the data
    'attributes' => [ / the attributes array specifies the microformat properties
        'p-name:profile.name', // get the user's name from the profile relation
        'p-email',
        'p-tel:phone.value',
        [ // Additional markup that is not a microformat property
            'value' => 'Address',
            'template' => '{value}' // with it's own template
        ],
        [
            'property' => 'p-adr',
            'microformat' => 'h-adr, // Markup the address with an embedded h-adr microformat
            'model' => $user->address, // we can specify a new model for embedded microformats; if not given the parent microformat model is used
            'template' => '{value}', // a new template for h-adr
            'attributes' => [
                'p-street-address', // fetch data from $user->address->street_address
                'p-locality',
                'p-region',
                'p-postal-code',
                [
                    'property' => 'p-geo',
                    'microformat' => 'h-geo',
                    'template' => '{label}{value}',
                    'formatter' => [ // use the included formatter for latitude and longitude
                        'class' => '\\beastbytes\\microformats\\Formatter',
                        'coordinateFormat' => '%02d %02.6f h'
                    ],
                    'attributes' => [
                        'property' => 'p-latitude:latitude:latitude', // microformat property:model attribte:format
                        'property' => 'p-longitude:longitude:longitude'
                    ]
                ]
            ]
        ]
    ]
]);
```

See the source code for more configuration details.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3949d ago

Major Versions

v0.1 → v1.0.02015-07-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0b5133b5137b26eeb25056449c28364ac0af31836eefba78912a9c8f0743aa3?d=identicon)[BeastBytes](/maintainers/BeastBytes)

---

Top Contributors

[![beastbytes](https://avatars.githubusercontent.com/u/1470144?v=4)](https://github.com/beastbytes "beastbytes (9 commits)")

---

Tags

yii2widgetmicroformatsmicroformatmicroformats2

### Embed Badge

![Health badge](/badges/beastbytes-yii2-microformats/health.svg)

```
[![Health](https://phpackages.com/badges/beastbytes-yii2-microformats/health.svg)](https://phpackages.com/packages/beastbytes-yii2-microformats)
```

###  Alternatives

[softark/yii2-dual-listbox

Bootstrap Dual Listbox Widget for Yii 2

20144.4k11](/packages/softark-yii2-dual-listbox)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
