MobileFrontend
Mobile optimised frontend for MediaWiki
Loading...
Searching...
No Matches
MobileFormatter Class Reference

Converts HTML into a mobile-friendly version. More...

+ Inheritance diagram for MobileFormatter:
+ Collaboration diagram for MobileFormatter:

Public Member Functions

 __construct ( $html)
 @inheritDoc
 
 applyTransforms (array $transforms)
 Performs various transformations to the content to make it appropriate for mobile devices.
 

Static Public Member Functions

static canApply ( $text, $options)
 Check whether the MobileFormatter can be applied to the text of a page.
 

Detailed Description

Converts HTML into a mobile-friendly version.

Member Function Documentation

◆ applyTransforms()

MobileFormatter::applyTransforms ( array $transforms)

Performs various transformations to the content to make it appropriate for mobile devices.

Parameters
array<IMobileTransform>$transforms lit of transforms to be sequentually applied to html DOM

◆ canApply()

static MobileFormatter::canApply ( $text,
$options )
static

Check whether the MobileFormatter can be applied to the text of a page.

Parameters
string$text
array$optionswith 'maxHeadings' and 'maxImages' keys that limit the MobileFormatter to pages with less than or equal to that number of headings and images.
Returns
bool

The documentation for this class was generated from the following file: