Skip to content
/ ampify Public

PHP package to ampify your <img> tags to <amp-img>

License

Notifications You must be signed in to change notification settings

artka54/ampify

Repository files navigation

ampify

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

This is a package to convert regular html <img> tags to those obligated by Google-Amp <amp-img>. This package is tested with ckeditor.

Install

Via Composer

$ composer require artka54/ampify:1.0.1

Usage

use artka54\ampify\Ampify as Ampify;

$Ampify   = new Ampify($htmlToConvert);
$Ampified = $Ampify->ampifyImgs();

WARNING: Your img must contain src, style(indicating width and height) and alt (can be empty) attributes. E.g a properly formatted img tag that can be successfuly converted with this package:

<img alt="here is the alt" src="http://example.com/blahblah.png" style="height:599px; width:900px"> 

Change log

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security related issues, please email artka54@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

PHP package to ampify your <img> tags to <amp-img>

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages