Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antonshevchuk/jquery-php
Don't use this package unless you understand why it's considered an antipattern
https://github.com/antonshevchuk/jquery-php
jquery jquery-ajax php php-library
Last synced: 3 months ago
JSON representation
Don't use this package unless you understand why it's considered an antipattern
- Host: GitHub
- URL: https://github.com/antonshevchuk/jquery-php
- Owner: AntonShevchuk
- License: mit
- Created: 2015-03-13T08:27:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-03-19T10:24:33.000Z (10 months ago)
- Last Synced: 2024-09-26T03:39:00.404Z (4 months ago)
- Topics: jquery, jquery-ajax, php, php-library
- Language: JavaScript
- Homepage: https://jquery.hohli.com
- Size: 130 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# jQuery PHP
This library facilitates working with the jQuery framework from the server-side.
> However, it's important to note that this approach is considered an antipattern. Server-side code typically shouldn't have knowledge of HTML structure or manipulate the DOM in this manner.
## Requirements
* PHP 7.4.0 or higher (with JSON extension)
* jQuery 1.10 / 2.2 / 3.3 or higher## Documentation
### Installation
Install Composer in Your Project.
Run this in your command line:
```shell
curl -sS https://getcomposer.org/installer | php
```Or [download composer.phar](https://getcomposer.org/composer.phar) into your project root.
Execute this in your project root.
```shell
php composer.phar install
```### Usage
Add the autoloader to your PHP file.:
```php
require 'vendor/autoload.php';
```After this, you can use this jQuery-PHP library in your PHP code, for example, this is `index.php`:
```php
use function AntonShevchuk\jQuery\jQuery;
use function AntonShevchuk\jQuery\jQueryContainer;// create jQuery-way queries
jQuery('#demo')
->html('Server time: ' . date('H:i:s'))
->css('backgroundColor', '#ffffdd')
->animate(['opacity' => 'show'], 3000)
->animate(['opacity' => 'hide'], 3000)
;// return JSON
print json_encode(jQueryContainer());
```Include jQuery and jQuery-PHP library:
```html
```
Add a call in your HTML page:
```html
Run demo snippet
...
```### Examples
You can find more examples on the site: https://jquery.hohli.com
## AuthorThe project is developed by [Anton Shevchuk][1], and distributed under [MIT LICENSE][2]
[1]: https://anton.shevchuk.name/
[2]: https://raw.githubusercontent.com/AntonShevchuk/ukrainian-typography-keyboard-layout/master/LICENSE