PHP2HTML
Clever html engine
Procedural block-structured programming with the PHP2HTML
library gives you easy central maintenance of your UI-code.
The PHP2HTML library are used in PHP applications to produce dynamic HTML/CSS/JS code with advanced features.
Library consists of a collection of functions that produce both standard HTML elements and special usefull variants.
With this library you can program a complete program, both backstage and frontstage, source code in PHP.
From your compact block-structured source code, the generator produces the necessary html code in a >5:1 ratio
In other words, you only have to write code that takes up 20% of the final code...
The PHP2HTML system has built-in integration with several powerful open-source projects, Font-awesome, Tablesorter, Jquery, tinyMCE, which makes it easy to take advantage of these.
| Integrated advantages of the system: | |
| Translation | Advanced translation system for your entire program interface |
| Icons | Option for font-awesome icons anywhere |
| User Advice | Tooltip, placeholder and pop-up user tip (hint/title) for all html elements |
| Context Menu | Popup menu-system activated on mouse Rightclick |
| Cards | Compact adaptive layout with collapsible cards |
| Tables | Advanced sortible tables based on Mottie Table Sorter system |
| HTML editor | TinyMCE integrated library |
| Library Location | Optional use of libraries locally or on the web (CDN) |
| Adaptive | Narrow cards suitable for adaptive fit |
| Date Lookup | Easily enter dates with the browser's date picker interface |
| Validation | Checks browser input validation |
| PHP 8.5+ | Compatible with latest PHP |
| Block oriented | Provides compact and clearer code... |
PHP is the language for producing server-side backend programming.
With PHP2HTML you can also produce client-side frontend programming in PHP.
Thus, you can now program your entire project in PHP.
Code and Time-saving when you are familiar with the system
Don't reinvent the Wheel, use PHP2HTMLβ¦
This compact height level code:
Show the codeHide the code
// php: htm_Input(labl:'@Amount', icon:'fas fa-euro', vrnt:'dec2', hint:'@Demo of htm_Input Field variant dec2: number with 2 decimal', name:'dec2', valu:0, wdth:'150px', algn:'center', unit:'<$ ');
// HTML: <div class="inpField" id="inpBox" style="margin: auto; width: 150px; display: inline-block;"> <input type= "text" id="dec2" name="dec2" value="$ 0,00" class="boxStyle" style="text-align: center; font-size: 14px; font-weight: 600; " oninvalid="this.setCustomValidity('Wrong or missing data in htm_Input(Dec2) ! ')" oninput="setCustomValidity('')" placeholder="Enter..." pattern="^\d*\.?((25)|(50)|(5)|(75)|(0)|(00))?$" /> <abbr class= "hint"> <label for="dec2" style="font-size: 12px; "> <div style="white-space: nowrap; margin-left: auto;"> Amount </div> </label> <data-hint style="top: 45px; left: 2px;"> Demo of htm_Input Field Variant dec2: number with 2 decimal <br>Unit: <$ </data-hint> </abbr> </div>
Unit: $
placeholder, validation, hint, colors, dimensions and much more...
As you can see, the source code is very compact. Less than 1/5 !
It is build with two functions: htm_Page_() and htm_Page_end()
Here are the page title, the window background and content align setup.
All the needed preparing (calling libraries) is done here.
Example: htm_Page_(
Mouse-over "Paremeters" shows hint !
It is build with two functions: htm_Card_() and htm_Card_end()
It consists of: icon + header - a body with content - and a footer that can be hidden.
The header-caption is automatic translated to the current selected language.
When clicking the caption-text in the header, it will show/hide the body & footer content.
In the headers right side there are icons to open/close all the cards in the window.
Cards has predefined widths, and its position will swap, if the window-width is to small.
Cards can be used as a "Local Menu" and to keep overview...
Example: htm_Card_(
htm_RowCol_() / htm_RowCol_next() / htm_RowCol_end() to create a column layout.
Example: htm_RowCol_(
and htm_RowCol_end()
It is build with function htm_Input()
It contains a Border, - a Label - and a Data-field
The Label: is a translated caption for the field. When howering a translated hint will be shown.
The Data-field: If NULL data, a translated placeholder is shown.
The Border: can be colored to signale special conditions.
At this time there are 25 htm_Input() variants: 'intg', 'text', 'dec0', 'dec1', 'dec2',
'num0', 'num1', 'num2', 'num3', 'barc', 'mail', 'link', 'sear', 'file', 'imag',
'date', 'time', 'week', 'mont', 'rang', 'butt', 'colr', 'phon', 'pass', 'area'
Example: htm_Input(
It has fixed (sticky) column headers, and Scrolling content-window.
Column wise it can: Filter - Sort - Width-Resize
Row wise it can: Create - Change - Delete - Spec. Buttons - set background color
Above and underneth the table, you can use special captions and notes.
Example: htm_Table(
Examples:
htm_MultistateButt(); - A button with 3 or more states
htm_Dialog(); - A system with messages to the user.
Pmnu_(); / Pmnu_end(); - A context popup menu system.
{file-name}.{content-type}.{file-type}
{file-names}: settings index
{content-types}: .page .inc .lib .min .css .js (the secundary type)
{file-types}: .png .php .htm .txt .json (the primary type)
Example: intropage.css.php
Rules for naming funktions:
Block-start: {name}_
Block-end: {name}_end
{name} could be htm_page / htm_card
The '@'-prefix in strings indicates that it is a translatable text.
This introduction is of course developed with the PHP2HTML-system.