Cloneable Instantiable
public __construct ( string $name , string $confirmQuestion = '' )

Set up an AJAX callback

  • param string $name JavaScript function name to be created
  • param string $confirmQuestion prompt with this question if set The $name is used as the generated function name. Is is also POSTed to the page as the 'action' parameter.
public addFunction ( string $function , string $script ) : PHPFUI\AJAX

Add a function parameter and the script that matches the
parameter type according to jQuery.ajax

public execute ( array $parameters ) : string

Return JavaScript that will execute a function call

  • param array $parameters anything you want to pass as data to the AJAX call
  • return string of JavaScript code to be added to the page
public getPageJS () : string

Get the generated JavaScript function to be added to the

  • return string JavaScript function
public isMyCallback ( $post ) : bool

Return true if the post is from this AJAX call

protected array $conditions
protected string $name
protected string $question
© 2022 Bruce Wells
Search Namespaces \ Classes