Fork me on GitHub

Exporting classes and functions from PHP to Javascript


Exports from PHP to javascript

The Jaxon library exports classes and functions from a PHP application to javascript, so they can be called directly from a webpage in a browser using Ajax.

When a PHP class is exported, a javascript class with the same name is automatically created and included in the webpage.

Calls from javascript to PHP

When the javascript class is called in the browser, an Ajax request is automatically created and sent to the server with the parameters passed to the function.

The Jaxon library receives the request, calls the PHP class with the parameters, and returns the result to the webpage.

Editing webpage content

The Jaxon\Jaxon\Response object provides functions to perform 3 types of operations in the web page.

  • Edit the page content (text)
  • Edit the page presentation with CSS
  • Run javascript code in the page

Add new features

The Jaxon plugins enrich the Jaxon\Jaxon\Response object with new functionalities.

They provide some simple API in PHP to execute sets of complex actions in a web page, or to call third-party javascript libraries.