PHP Classes

PHP HTML Generator Library with jQuery Support: Generate HTML with jQuery function call support

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2023-09-13 (6 months ago) RSS 2.0 feedNot enough user ratingsTotal: 165 This week: 1All time: 8,898 This week: 560Up
Version License PHP version Categories
jquery 1.0.3Freeware5HTML, PHP 5
Description 

Author

This package can generate HTML with jQuery function call support.

The main class provides a function call handler ( __call ) that can determine the name of the HTML tag to add to a page from the function name that developers use in the code that calls the class.

This allows the package to add any HTML tag to the page with less class code.

The package also provides a class to add JavaScript code that calls the jQuery library functions.

Innovation Award
PHP Programming Innovation award nominee
April 2023
Number 3
All sites served using PHP need to output HTML. One way to output that HTML code using PHP is to compose and generate the HTML from parameters that define details of the HTML tags that developers need to develop to manage the page output.

This package provides a class to generate HTML tags and JavaScript code to call the jQuery library.

The class uses the PHP __call handler to allow the addition of any HTML tag or jQuery function library call to the current page output.

This way, the code of these classes is minimal, as they do not need to have many functions to support all HTML tags or jQuery functions.

Manuel Lemos
Picture of Kashif Rafi
  Performance   Level  
Name: Kashif Rafi <contact>
Classes: 1 package by
Country: Pakistan Pakistan
Age: 44
All time rank: 423954 in Pakistan Pakistan
Week rank: 411 Up9 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php
//Usage example of jQuery and HtmlCode classes
include 'jQuery.php';
include
'HtmlCode.php';

$jq = new jQuery("document");
$htm = new HtmlCode();

$htm->head_start();
$htm->title_start()->contents('Web Page Title')->title_end();
$htm->script_start(array('src'=>'https://code.jquery.com/jquery-3.4.1.min.js'))->script_end();
$htm->head_end();
$htm->body_start();
$htm->div_start(array('class'=>'testDivClass','id'=>'testDiv','styleSelector'=>'.testDivClass','style'=>array(
   
'width'=>'500px',
   
'padding'=>'20px',
   
'border'=>'1px solid #000',
   
'margin'=>'50px auto'
)));
$htm->p_start();
$htm->contents('Some paragraph content here');
$htm->p_end();
$htm->div_end();
$documentReady = function(){
   
$jq1 = new jQuery("'#testDiv'");
   
$jq1->find('p');
   
$jq1->css('color','blue');
   
$clickHandle = function(){
       
$jq2 = new jQuery("this");
        return
$jq2->css('color','red')->output();
    };
   
$jq1->on('click',$clickHandle);
    return
$jq1->output();
};
$scriptOutput = $jq->ready($documentReady)->output();
$htm->script_start()->contents($scriptOutput)->script_end();
$htm->body_end();
echo
$htm->output();


  Files folder image Files  
File Role Description
Accessible without login Plain text file fromjson.php Example generating html code from json
Plain text file HtmlCode.php Class generates html code in php
Accessible without login Plain text file index.php Example usage examples of jquery and htmlcode php classes
Plain text file jQuery.php Class generates jquery code
Accessible without login Plain text file jsoncode.json Conf. list of html tags in json format

 Version Control Unique User Downloads Download Rankings  
 0%
Total:165
This week:1
All time:8,898
This week:560Up