![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2020-03-28 (19 hours ago) ![]() | Not enough user ratings | Total: 208 This week: 5 | All time: 8,185 This week: 69![]() |
Version | License | PHP version | Categories | |||
ampgeneratorone 1.0.1 | GNU Lesser Genera... | 5 | HTTP, PHP 5, Performance and optimiza... |
Description | Author | |
This package can generate HTML for using as Google AMP site. Innovation Award
|
|
The library generates Google AMP sites using PHP by using procedural code.
This application simplifies (via code) the generation of an AMP site. It's easiest to program, just a few of lines of code and that's it.
For example, let's say that you want to add a new section
$secImage= new SectionModel("The Cupcakes","","/image.jpg");
$secImage->buttons[]=new ButtonModel("More Information","#");
$secImage->buttons[]=new ButtonModel("More Information","#","warning");
$amp->sectionImage($secImage,2250,441);
It will generate the next visual:
use eftec\AmpGeneratorOne\AmpGeneratorOne;
use eftec\AmpGeneratorOne\ButtonModel;
use eftec\AmpGeneratorOne\FooterModel;
use eftec\AmpGeneratorOne\HeaderModel;
use eftec\AmpGeneratorOne\HeadModel;
use eftec\AmpGeneratorOne\LinkModel;
use eftec\AmpGeneratorOne\SectionModel;
include "lib/AmpGeneratorOne.php";
$amp=new AmpGeneratorOne("https://www.canonical.com","https://www.canonical.com/amp");
// #
$amp->startAmp(new HeaderModel("description","title","favicon.ico"));
// # sidebar (optional)
$amp->sidebar($menu); // $menu is an array of /LinkModel()
// #1 head (the top bar)
$amp->head(new HeadModel("",$base."logo.png"),70,70);
// # example section
$amp->sectionFirst(new SectionModel("Title","Description"));
// # footer
$amp->sectionFooter(new FooterModel("Copyright something(c)","See as desktop"));
amp->render(); // you also could generate a file.
Tablet version
Mobile version
.jpg)
Mobile version (slider open)
AmpGeneratorOne constructor.
`
php
$tmp=$ampgeneratorone->fixRelativeUrlthis();
`
## Method genStructured
It generates the social and seo structure (Twitter card, Facebook OG and Google Schema)`
php
$tmp=$ampgeneratorone->genStructuredthis();
`
## Method startAmp
Start to generate an Amp site.`
php
$tmp=$ampgeneratorone->sidebarthis();
`
## Method head
Generates the header navigation`
php
$tmp=$ampgeneratorone->headthis();
`
## Method sectionFooter
It generates a footer of the amp site.`
php
$tmp=$ampgeneratorone->sectionFooterthis();
`
## Method sectionAnalytics
Generates a Google Analytics section`
php
HeaderModel());
`
`
php
$tmp=$ampgeneratorone->sectionAnalyticsthis();
`
## Method sectionFirst
It draw a first section (hero style)`
php
$tmp=$ampgeneratorone->sectionFirstthis();
`
## Method sectionImageButton
It generates a section with a single button.`
php
$tmp=$ampgeneratorone->sectionImageButtonthis();
`
## Method sectionText
It generates a section with a text.`
php
$tmp=$ampgeneratorone->sectionTextthis();
`
## Method sectionTextQuote
It generates a quote text`
php
$tmp=$ampgeneratorone->sectionTextQuotethis();
`
## Method sectionUL
It generates an unsorted list section`
php
$tmp=$ampgeneratorone->sectionULthis();
`
## Method sectionOL
It generates a sorted list section`
php
$tmp=$ampgeneratorone->sectionOLthis();
`
## Method sectionButtons
It generates a section with one (or more than one) buttons.`
php
$tmp=$ampgeneratorone->sectionButtonsthis();
`
## Method sectionCols
It generates a section with columns`
php
$tmp=$ampgeneratorone->sectionColsthis();
`
## Method sectionHeaderCentral
It generates a header central section. It could includes buttons.`
php
$tmp=$ampgeneratorone->sectionHeaderCentralthis();
`
## Method sectionRawIt generates a section with an image content.
`
php
$tmp=$ampgeneratorone->sectionImageContentthis();
`
## Method sectionImageContentLeft
It generates a section with a image content at the left.`
php
$tmp=$ampgeneratorone->sectionImageContentLeftthis();
`
## Method sectionTable
It generates a table`
php
$tmp=$ampgeneratorone->sectionTablethis();
`
## Method sectionImage
It generates an image. The size of the image is required to calculate the ratio`
php
$tmp=$ampgeneratorone->sectionImagethis();
`
## Method sectionGMapFull
It generates a google map section. It can't be locate at the 30% top of the site (Amp restriction)`
php
$tmp=$ampgeneratorone->sectionGMapFullthis();
`
## Method sectionGMapBoxed
It generates a google map (boxed) section. It can't be locate at the 30% top of the site (Amp restriction)`
php
$tmp=$ampgeneratorone->sectionGMapBoxedthis();
`
## Method sectionNavigation
It generates a footer navigation`
php
$tmp=$ampgeneratorone->sectionNavigationthis();
`
## Method sectionColImage
It generates a section with images and text.`
php
$tmp=$ampgeneratorone->sectionColImagethis();
`
## Method genModifyStyleFluent operation, it changes the background color of the next section
`
php
$tmp=$ampgeneratorone->setBackgroundColorthis();
`
## Method setBgImage
Fluent operation, it changes the background image of the next section`
php
$tmp=$ampgeneratorone->setBgImagethis();
`
## Method setClassTextColor
Fluent operation, it sets the class of the text`
php
$tmp=$ampgeneratorone->setClassTextColorthis();
`
## Method setPadding
Fluent operation, it changes the padding`
php
$tmp=$ampgeneratorone->setPaddingthis();
`
## Method resetDefaultIt reset to the default background color and text class
It renders the result page.
It renders the result to file
`
php
$tmp=$ampgeneratorone->genLinkthis();
`
## Method genButton
Generate the first link of an array only if array constains information or the link is not empty.> Note: You could change the color. !
You could validate your amp on Google search validation
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
58% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.