<?php /* lets suposse you have this folder tree yourproject/ vendors/ lib_1/ lib_n/ theframework/ -->uncompressed zip helpers/ index.php */ //this file is: yourproject/index.php include_once("vendors/theframework/helpers/autoload.php"); use TheFramework\Helpers\HelperInputText; $oInput = new HelperInputText(); $oInput->set_value("Hello World"); $oInput->add_class("form-control"); $oInput->show();
It allows you to create <a>...</a> html element
<?php use TheFramework\Helpers\HelperAnchor; use TheFramework\Helpers\HelperRaw; $arHtml = []; $arHtml[] = new HelperRaw("<ul class=\"nav nav-pills\">"); $arHtml[] = new HelperRaw("<li class=\"nav-item\">"); $arHtml["anchor_1"] = new HelperAnchor("Eduardoaf.com"); $arHtml["anchor_1"]->add_class("nav-link active"); $arHtml["anchor_1"]->set_href("http://eduardoaf.com"); $arHtml["anchor_1"]->set_target("blank"); $arHtml[] = new HelperRaw("</li>"); $arHtml[] = new HelperRaw("<li class=\"nav-item\">"); $arHtml["anchor_2"] = new HelperAnchor("Simple link"); $arHtml["anchor_2"]->add_class("nav-link"); $arHtml["anchor_2"]->set_href("#"); $arHtml[] = new HelperRaw("</li>"); $arHtml[] = new HelperRaw("</ul>"); foreach ($arHtml as $oHtml) $oHtml->show(); ?>
<ul class="nav nav-pills"><li class="nav-item"><a href="http://eduardoaf.com" target="_blank" class="nav-link active">Eduardoaf.com</a> </li><li class="nav-item"><a href="#" class="nav-link">Simple link</a> </li></ul>
<?php use TheFramework\Helpers\HelperForm; use TheFramework\Helpers\HelperP; $oForm = new HelperForm(); $oForm->add_class(""); $oForm->add_style("border:1px dashed #4f9fcf;"); $oForm->add_style("padding:5px;"); $oForm->set_id("myForm"); $oForm->add_control(new HelperP("<b>Links in a form</b>")); for($i=0; $i<3; $i++) $oForm->add_control(new HelperAnchor("Anchor $i","anchor_$i","#link")); $oForm->show(); ?>
<form id="myForm" method="post" style="border:1px dashed #4f9fcf;;padding:5px;"> <p> <b>Links in a form</b></p> <a id="anchor_0" href="#link">Anchor 0</a> <a id="anchor_1" href="#link">Anchor 1</a> <a id="anchor_2" href="#link">Anchor 2</a> </form>