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 browser.

Editing webpage content

The Response object returned by the Jaxon request contains a set of operations to be executed 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 library can be extended with plugins which will enrich the Response object with new functionalities.

They are very easy to build, and they can provide some simple API in PHP to execute sets of complex actions in a web page, or to run any javascript code.