Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.63 KB | None | 0 0
  1. <?php
  2.    
  3.     define("BASEDIR", dirname(__FILE__));
  4.     ini_set("include_path", join(PATH_SEPARATOR,array(
  5.         BASEDIR,
  6.         BASEDIR.DIRECTORY_SEPARATOR."vendor",
  7.         ini_get("include_path")
  8.     )));
  9.     require_once "autoload.php";
  10.    
  11.     use Jaxon\Response\Response;
  12.  
  13.     // The HelloWorld class
  14.     class HelloWorld
  15.     {
  16.         public function sayHello($isCaps)
  17.         {
  18.             $text = ($isCaps) ? 'HELLO WORLD!' : 'Hello World!';
  19.             $response = new Response();
  20.             $response->alert($text);
  21.             return $response;
  22.         }
  23.     }
  24.  
  25.     // Get the core singleton object
  26.     $jaxon = jaxon();
  27.  
  28.     // Register an instance of the class with Jaxon
  29.     $jaxon->register(Jaxon::CALLABLE_OBJECT, new HelloWorld());
  30.  
  31.     // Call the Jaxon processing engine
  32.     $jaxon->processRequest();
  33. ?>
  34. <!doctype html>
  35. <html>
  36.     <head>
  37.         <title>Jaxon Simple Test</title>
  38.         <meta charset="utf-8">
  39.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  40.         <meta name="viewport" content="width=device-width, initial-scale=1">
  41.         <meta name="description" content="">
  42.         <meta name="author" content="">
  43.         <link rel="icon" href="/favicon.ico">
  44.         <?php
  45.             // Insert the Jaxon CSS code into the page
  46.             echo $jaxon->getCss();
  47.         ?>    
  48.     </head>
  49.     <body>
  50.         <input type="button" value="Submit" onclick="JaxonHelloWorld.sayHello(1);return false;" />
  51.     </body>
  52.     <?php
  53.         // Insert the Jaxon javascript code into the page
  54.         echo $jaxon->getJs();
  55.         echo $jaxon->getScript();
  56.     ?>    
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement