DustPress.JS
A DustPress plugin that provides a handy JavaScript library for using your DustPress Model methods on the front end.
by Geniem Oy / Miika Arponen, Ville Siltala & Arttu Mäkipörhölä · github.com/devgeniem/dustpress-js · website
★ 3stars
69kcomposer installs
3forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/devgeniem/dustpress-js/archive/refs/heads/master.zipAlso on Packagist as devgeniem/dustpress-js:
composer require devgeniem/dustpress-jsFrom the readme
DustPress Plugin: DustPress.js
A DustPress plugin that provides a handy JavaScript library for using your DustPress model methods on the front end.
- Contributors: devgeniem / Nomafin, villesiltala, godbone
- Plugin url: https://github.com/devgeniem/dustpress-debugger
- Tags: dustpress, wordpress, plugins, dustjs, dust.js
- Requires at least: 4.9.0
- Requires DustPress version: 1.25.0
- Tested up to: 5.2.0
- License: GPL-3.0
- License URI: http://www.gnu.org/licenses/gpl-3.0.html
Usage
You can call for SomeModel's method SomeMethod with following code:
tidy: true parameter cleans up the data tree a bit for more usability. Feel free to try the queries with and without it to see the difference.
args parameter passes arguments to the PHP side. They can be accessed there with $this-getargs();.
If you want, you can even render HTML with Dust templates.
This code takes the data of SomeMethod and renders it with SomePartial. Variable data then contains the ready html.
If you still want to get the data output as well, use argument data: true and you will get the resulting data as the second parameter of your success function.
You can also omit the method completely if you want to
Read the full README on GitHub →