PHPackages                             shomeya/shomeya\_utility - 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. shomeya/shomeya\_utility

ActiveDrupal-module[Utility &amp; Helpers](/categories/utility)

shomeya/shomeya\_utility
========================

Shomeya utility tools for Drupal

0.1.2(9y ago)0351GPL 2.0+PHP

Since Feb 27Pushed 9y ago2 watchersCompare

[ Source](https://github.com/shomeya/shomeya_utility)[ Packagist](https://packagist.org/packages/shomeya/shomeya_utility)[ RSS](/packages/shomeya-shomeya-utility/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

Shomeya Utility module for Drupal
=================================

[](#shomeya-utility-module-for-drupal)

This module provides several useful features, such as an environment indicator, a style guide, some render elements and template functions/helpers.

Build metadata
--------------

[](#build-metadata)

This module provide a helper class to access information about the build, such as latest Git commit, date, time, as well as who and where the build was packaged. This information is available in the status report at admin/reports/status. It also includes links to Github for relevant commits as long as the Github URL is set in settings.php:

```
$config['shomeya_utility.settings']['github_url'] = 'https://github.com/shomeya/projectname';
```

Environment indicator
---------------------

[](#environment-indicator)

An environment indicator is available that provides text and an icon indicating which environment you are viewing:

[![environment indicator for production with green checkmark](/images/environment-indicator.png?raw=true)](/images/environment-indicator.png?raw=true)

This functionality is based on the enviroment specified in the settings.json file and is mapped in src/Environment.php.

Style Guide
-----------

[](#style-guide)

This module provides a sample style guide at styleguide/web with additional pages for form elements and Drupal elements at styleguide/web/drupal/form and styleguide/web/drupal/elements.

Elements
--------

[](#elements)

A time element is defined in src/Element/Time.php. This element also supports optionally rendering as a dynamic 'time ago' with Javascript if the option is enabled.

```
$build = [
  '#type' => 'time',
  '#timestamp' => '1456527560', // Unix timestamp to use for the date, will be used to populate a ISO 8601 in the 'datetime' attribute of the tag
  '#value' => 'Friday, Feb. 26th', // The value to be displayed
  '#options' => [
    'timeago' => TRUE, // Whether or not the element should be rendered as timeago using javascript
  ],
  '#attributes' => [ // additional attributes for the element
  	'class' => 'my-time-element',
  ],
];
```

Template functions/helpers
--------------------------

[](#template-functionshelpers)

There are several helper function that are exposed to Twig templates:

#### URL from URI

[](#url-from-uri)

This helper turns a Drupal URI (such as `internal:/about-us` , `entity:node/1234`, or `base:robots.txt`) into a fully qualified URL:

```
My Link
```

It supports options that will be based to [Url::fromUri()](https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Url.php/function/Url%3A%3AfromUri/8) such as `query`, `absolute`, `https`, and more:

```
My Link
```

#### Time

[](#time)

Supports creation of a time element from a timestamp:

```
{# Without value provided a value will be formatted from the timestamp #}
{{ time(item.timestamp) }}
```

It supports an optional value to be displayed if you wish to customize the date display:

```
{{ time(item.timestamp, item.date) }}
```

Finally it supports all options that can be passed to the time element, and additional options for generating a value if one is not provided:

```
{# Type and format correspond to options passed to DateFormatter::format() #}
{{ time(item.timestamp, null, {type: custom, format: 'F j Y'}) }}
```

The last example will output something like:

```
February 26 2016
```

#### Time ago

[](#time-ago)

Support time element from timestamp with timeago set to true:

```
{{ time_ago(item.timestamp) }}
```

The output will be:

```
Fri, 02/26/2016 - 14:59
```

This also automatically includes [jquery.timeago.js](http://timeago.yarp.com) which will format the value as a time ago, such as 'less than a minute ago.'

This support the same options for value and options as the time helper.

#### Time From String

[](#time-from-string)

This function supports generating a time element from a date string parsed with [strtotime()](http://php.net/strtotime):

```
{{ time_from_string('Fri, 02/26/2016 - 14:59') }}
```

Also allows for value, options.

#### Time ago from string

[](#time-ago-from-string)

Supports generating a time ago tag from a string:

```
{{ time_ago_from_string('Fri, 02/26/2016 - 14:59') }}
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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 ~13 days

Total

4

Last Release

3370d ago

Major Versions

0.1.2 → 1.0.0-rc12017-04-07

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/shomeya-shomeya-utility/health.svg)

```
[![Health](https://phpackages.com/badges/shomeya-shomeya-utility/health.svg)](https://phpackages.com/packages/shomeya-shomeya-utility)
```

###  Alternatives

[omnia-digital/livewire-calendar

Laravel Livewire calendar component

13262.4k](/packages/omnia-digital-livewire-calendar)[marcelweidum/filament-expiration-notice

Customize the livewire expiration notice

94113.9k5](/packages/marcelweidum-filament-expiration-notice)[nass600/get-id3

PHP library for handling audio/video files metadata

5833.3k3](/packages/nass600-get-id3)

PHPackages © 2026

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