PHP Classes

JQPHP: Generate HTML using jQuery added programmatically

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 167 All time: 8,885 This week: 455Up
Version License PHP version Categories
jqphp 1.0.0GNU General Publi...5.4HTML, PHP 5
Description 

Author

This package can generate HTML using jQuery added programmatically.

It can generate HTML with JavaScript statements that can perform operations like:

- Showing alert messages
- Select elements with give selector expressions
- Set CSS styles or other element attributes
- Redirect the browser to other pages
- Toggle the visibility of elements
- Animate html elements
- Etc..

Picture of Samuel Adeshina
  Performance   Level  
Name: Samuel Adeshina is available for providing paid consulting. Contact Samuel Adeshina .
Classes: 19 packages by
Country: Nigeria Nigeria
Age: 25
All time rank: 5232 in Nigeria Nigeria
Week rank: 29 Up3 in Nigeria Nigeria Down
Innovation award
Innovation award
Nominee: 7x

Winner: 1x

Example

<?php
   
require_once("JQPhp.php");
    use
JQPhp\Selector\Attributes as Attributes;
    use
JQPhp\Selector\Basics as Basics;
    require_once(
"html.html");
?>
<?php
/* echo "<a id='vi' href='#'>Hi, I'm Samuel</a><br/>";
    echo "<a id='vim' href='#'>Hi, I'm Samuel</a><br/>";
    echo "<p class='small'>I am a very small text</p>";*/
   
$enable = new JQPhp\Enable("jquery.js");
   
$prefix = new Attributes\Contains("a", "hreflang", "en" new JQPhp\jquery());
   
$prefix->css("border", "3px dotted green");

?>


Details

JQPhp

JQPhp is a PHP Library that was built to perform javascript operations directly within PHP codes. A simple explanation would be instead of typing the following to display an alert &lt;script&gt;$(document).ready(function(){ alert("This is an alert"); }) All you have to do is $jqphp->Alert("This is an alert").

It hasn't been built to replace JQuery or Javascript but to make it easy to work with these technologies from PHP without worrying about them. In fact, it makes calls to the JQuery library from behind the scenes.

The library has been categorized into various namespaces depending on what the classes do. the available namespaces are:

  1. \JQPhp
  2. \JQPhp\Shared
  3. \JQPhp\Selector
  4. \JQPhp\Selector\Attributes
  5. \JQPhp\Selector\Basics
  6. \JQPhp\Selector\Filters 7 ..... and so on. (This library is still in active development)

A very simple usage of this class would be to make the background color of all anchor elements where the href attribute is http://samshal.users.phpclasses.org red and it is illustrated below:

use JQPhp; use JQPhp\Selector\Attributes;

$a-element = Attributes\Equals("a", "href", "http://samshal.users.phpclasses.org", new JQPhp\jquery()); $a-element->css("background-color", "red");

Visit this project's page at: http://samshal.github.io/JQPhp/ or feel free to send me an email: samueladeshina73 at gmail dot com


  Files folder image Files (11)  
File Role Description
Files folder imagemaster (2 directories)
Accessible without login Plain text file LICENSE Lic. License
Accessible without login Plain text file README.md Doc. Readme
Accessible without login Plain text file readme.txt Doc. Added a readme in .txt format

  Files folder image Files (11)  /  master  
File Role Description
Files folder imagedemo (3 files)
Files folder imagesrc (5 files)

  Files folder image Files (11)  /  master  /  demo  
File Role Description
  Accessible without login Plain text file demo.php Example Example
  Accessible without login HTML file html.html Data Example
  Accessible without login Plain text file jquery.js Data JQuery Library

  Files folder image Files (11)  /  master  /  src  
File Role Description
  Plain text file JQPhp.php Class Namespace
  Plain text file JQPhp.Selector.Attributes.php Class Namespace
  Plain text file JQPhp.Selector.Basics.php Class Namespace
  Plain text file JQPhp.Selector.Filters.php Class Namespace
  Plain text file shared.php Class Namespace

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:167
This week:0
All time:8,885
This week:455Up