Skip to content
Durisvk edited this page Sep 5, 2014 · 4 revisions

EOSS - Event Oriented Server Side

What is it?
Framework using PHP, JQuery and Ajax.
Why EOSS?
You can simply handle events on your serverside in xxxEOSS.php
How?
Simply create HTML layout (It must contain !!!) and xxxEOSS.php file. Set IDs to layout-elements and you can refer to them in your PHP file.

class xxxEOSS extends EOSS {
    public function load() {
        $this->csi->setFile("myLayout.html");
    }
    public function bind() {
        $this->csi->idOfAnyElement->onclick="myFunction"
    }
    public function myFunction() {
        $this->csi->idOfAnyOtherElement->value="HELLO WORLD!!!";
    }
}

then you need to step into a file config.eoss and make it looks like that:

	"home_eoss": "xxxEOSS",
	"layout_dir": "dirWhere'sMyLayout",
	"refresh": true

But how does it work?
It generates the class csi from your layout after calling setFile() function. Class csi consists of all your elements which have set ID. As you fill the bind() function it generates an Ajax request sent to RequestDealer class which has to deal with your myFunction() function. Result is returned to your layout. That's all :)
Can I use Model-View-Controller scripting?
Yes of course. And you don't have to. It's on your own choice :)
What's the default config?
Here you are:

	"home_eoss": "indexEOSS",
	"layout_dir": "view/",
	"refresh": true

So your app folder should contain directory view where you will add your layouts. Also there's need to have an indexEOSS class anywhere under your app directory. For MVC you should have it in app/controller/indexEOSS.php
Is there any way to dynamically change EOSS controller?
The answer is Yes! You can use predefined EOSS function redirect("nameOfEoss") to alternate between your EOSS classes.
What is CSI
It's not CSI Miami or other TV crimi serial. It's Client-Side Interface - Autogenerated class from your layout. It consists of all of your layout elements which have assigned ID attribute. These elements have their own attributes which are set in layout. If you want to use element's attribute on Server-Side and in the beggining have it empty just assign an empty value to it.

Clone this wiki locally