Login   Register  
PHP Classes
elePHPant
Icontem

File: jAPI-Remote.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Vladica Savic  >  jAPI Direct  >  jAPI-Remote.php  >  Download  
File: jAPI-Remote.php
Role: Example script
Content type: text/plain
Description: jAPI Remote Script
Class: jAPI Direct
Handle calls of JavaScript to PHP code
Author: By
Last change: Fixed small issue
Date: 4 years ago
Size: 859 bytes
 

Contents

Class file image Download
<?php
//Include jAPI Core and jAPIBaseClass
include("jAPI-CORE.php");

//Bellow is some demo classes with some basic functions
class MySimpleMath{
    public function 
Addition($firstParam$seccondParam) {
        
$sum $firstParam+$seccondParam;
        echo 
$sum;
    }
    public function 
CompareNumbers($firstNum$seccondNum) {
        
$comparingResults = ($firstNum == $seccondNum)?"The numbers are equal":"The number is not equal";
        echo 
$comparingResults;
    }

class 
MyStringMixer{
    public function 
ReverseString($inputString) {
        echo 
strrev($inputString);
    }
    public function 
JustSayHi($name) {
        echo 
"Hello ".$name;
    }
}

//Create new instance of jAPIBaseClass with names of all classes that you want to use separeted with comma...
new jAPIBaseClass('MySimpleMath,MyStringMixer');
?>