Ratings | | Unique User Downloads | | Download Rankings |
Not yet rated by the users | | Total: 167 | | All time: 8,888 This week: 455 |
|
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.. | |
|
|
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
<script>$(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:
-
\JQPhp
-
\JQPhp\Shared
-
\JQPhp\Selector
-
\JQPhp\Selector\Attributes
-
\JQPhp\Selector\Basics
-
\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
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.