PHPackages                             coyote/coyote-php-content-helper - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. coyote/coyote-php-content-helper

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

coyote/coyote-php-content-helper
================================

A php html content and image parsing helper library

1.0.6(3y ago)0122[1 issues](https://github.com/coyote-team/coyote-php-content-helper/issues)MITPHP

Since Apr 6Pushed 3y ago3 watchersCompare

[ Source](https://github.com/coyote-team/coyote-php-content-helper)[ Packagist](https://packagist.org/packages/coyote/coyote-php-content-helper)[ RSS](/packages/coyote-coyote-php-content-helper/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

Coyote PHP Content Helper
=========================

[](#coyote-php-content-helper)

A composer package PHP helper for the Coyote Drupal plugin, and Coyote Wordpress plugin.

Overview
--------

[](#overview)

The purpose of the package is to parse HTML content within string, and put the necessary image attributes for Coyote plugins into an abstracted image object. The content helper also has the functionality of changing the alt text of images based on the src of the images by parsing the HTML content within a string. If the HTML within the string is malformed then no image elements can be found when parsed.

Usage
-----

[](#usage)

To use the ContentHelper functions for gathering images a ContentHelper object must first be constructed, with input of a string of fully formed HTML.

```
$helper = new ContentHelper($wellFormedHTML);

```

### Get an array of Images

[](#get-an-array-of-images)

You can call the getImages function to get an array of Image objects.

```
$helper = new ContentHelper($wellFormedHTML);
$imageArray = $helper->getImages();

```

### Setting alt text for images

[](#setting-alt-text-for-images)

There are 2 functions for setting the alt text of an image

1. setImageAlt(string $src, string $alt)
2. setImageAlts($map)

For setImageAlt given a src string, and an string alt, the alt text for each image with that src will be changed to the given alt. This will return the newly modified HTML string.

```
$helper = new ContentHelper($wellFormedHTML);
$src = "foo.jpg";
$newAlt = "This is new alt test";
$newHTML = $helper->setImageAlt($src,$alt);

```

For setImageAlts given a map with the key being the src, and the value being the alt it will traverse the map and change the alt text for each src given to the alt text value and return the newly modified HTML string.

```
$helper = new ContentHelper($wellFormedHTML);
$map = ['foo.jpg'=>'New Alt for Foo','test.jpg'=>'New Alt for Test','example.jpg'=>'New Alt for Example'];
$newHTML = $helper->setImageAlts($map);

```

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.6% 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 ~60 days

Recently: every ~80 days

Total

7

Last Release

1232d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15685?v=4)[eLitmus PAC](/maintainers/pac)[@pac](https://github.com/pac)

---

Top Contributors

[![Pen-a11y](https://avatars.githubusercontent.com/u/85746241?v=4)](https://github.com/Pen-a11y "Pen-a11y (61 commits)")[![jkva](https://avatars.githubusercontent.com/u/217264?v=4)](https://github.com/jkva "jkva (9 commits)")[![PenHub1249](https://avatars.githubusercontent.com/u/54953357?v=4)](https://github.com/PenHub1249 "PenHub1249 (3 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/coyote-coyote-php-content-helper/health.svg)

```
[![Health](https://phpackages.com/badges/coyote-coyote-php-content-helper/health.svg)](https://phpackages.com/packages/coyote-coyote-php-content-helper)
```

###  Alternatives

[riclep/laravel-storyblok

A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs

6281.2k5](/packages/riclep-laravel-storyblok)[mwgg/airports

A JSON collection of ~29k entries with basic information about nearly every airport and landing strip in the world

7683.4k](/packages/mwgg-airports)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9845.4k](/packages/sauladam-shipment-tracker)[glauberportella/cnab-layouts-parser

Parser de arquivos de configuração CNAB gerados no projeto https://github.com/glauberportella/cnab-layouts

2154.5k](/packages/glauberportella-cnab-layouts-parser)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.4k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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