vitexsoftware / ease-html
Set of HTML rendering objects
Fund package maintenance!
Patreon
Installs: 1 276
Dependents: 5
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- vitexsoftware/ease-core: ^1.45
Requires (Dev)
README
Ease Framework Html
"My way how to assemble web page using PHP Objects."
Basic Example for HTML5 WebPage:
$head = new \Ease\Html\HeadTag( new \Ease\Html\TitleTag('Ease WebPage')); $body = new \Ease\Html\BodyTag(new \Ease\Html\HeaderTag( new \Ease\Html\H1Tag('Web Page'))); $body->addItem( new \Ease\Html\ArticleTag('Example')); $body->addItem(new \Ease\Html\FooterTag( new \Ease\Html\SmallTag( new \Ease\Html\ATag('v.s.cz','Vitex Software') ) )); $oPage = new \Ease\Html\HtmlTag([$head,$body]); echo $oPage;
or use the WebPage class:
$oPage = new \Ease\WebPage('Ease WebPage'); $oPage->addItem(new \Ease\Html\HeaderTag(new \Ease\Html\H1Tag('Web Page'))); $oPage->addItem(new \Ease\Html\ArticleTag('Example')); $oPage->addItem(new \Ease\Html\FooterTag(new \Ease\Html\SmallTag(new \Ease\Html\ATag('v.s.cz', 'Vitex Software')))); echo $oPage;
Special Classess
Main Glue of Ease\Html is
Ease\Container
Container can contain simple text, another object or mix od them.
$group = [ new StrongTag('strong text'), 'simple text ', new DivTag( new HrTag() ) ]; $heap = new Container(); $heap->addItem('text to include'); $heap->addItem( new H1Tag('heading) ); $heap->addItem( $group );
Ease\Document
Is smarter container able to hold Scripts and cascade styles
$oPage = new Page();
and finally:
Ease\WebPage
Is Page that include Head and Body elements
$oPage = new \Ease\WebPage('Page title'); $oPage->addItem( new \Ease\Html\ImgTag( 'images/sun.png' ); $oPagr->addJavaScript('alert("Let the sun shine in!")'); echo $oPage;
Implemented HTML5 tags:
- AddressTag
- ArticleTag
- AsideTag
- ATag
- AudioTag
- BdiTag
- BodyTag
- ButtonTag
- CanvasTag
- DatalistTag
- DdTag
- DetailsTag
- DialogTag
- DivTag
- DlTag
- DtTag
- EmbedTag
- EmTag
- FieldSet
- FigCaptionTag
- FigureTag
- FooterTag
- Form
- HeaderTag
- HeadTag
- HrTag
- HtmlTag
- H1Tag
- H2Tag
- H3Tag
- H4Tag
- CheckboxGroup
- CheckboxTag
- IframeTag
- ImgTag
- InputColorTag
- InputContainer
- InputDateTag
- InputDateTimeLocalTag
- InputDateTimeTag
- InputEmailTag
- InputFileTag
- InputHiddenTag
- InputMonthTag
- InputNumberTag
- InputPasswordTag
- InputRadioTag
- InputRangeTag
- InputSearchTag
- InputSubmitTag
- InputTag
- InputTelTag
- InputTextTag
- InputTimeTag
- InputUrlTag
- InputWeekTag
- JavaScript
- KeygenTag
- LabelTag
- LiTag
- MainTag
- MarkTag
- MenuItemTag
- MetaTag
- MeterTag
- NavTag
- OlTag
- OptionTag
- OutputTag
- PairTag
- ParamTag
- PreTag
- ProgressTag
- PTag
- RadiobuttonGroup
- RpTag
- RtTag
- RubyTag
- ScriptTag
- SectionTag
- Select
- SelectTag
- SimpleHeadTag
- SmallTag
- SourceTag
- Span
- SpanTag
- StrongTag
- SubmitButton
- SummaryTag
- SvgTag
- TableTag
- Tag
- Tbody
- TdTag
- TextareaTag
- Tfoot
- Thead
- ThTag
- TimeTag
- TitleTag
- TrackTag
- TrTag
- UlTag
- VideoTag
- WbrTag
Installation
composer require vitexsoftware/ease-html
Debian Repository
sudo apt install lsb-release wget echo "deb https://repo.vitexsoftware.com $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list sudo wget -O /etc/apt/trusted.gpg.d/vitexsoftware.gpg https://repo.vitexsoftware.com/keyring.gpg sudo apt update sudo apt install php-vitexsoftware-ease-html