Path

ez projects / ezjscore / forum / general / implemented features


Implemented features

You need to be logged in to post messages in the forums. New users may register here.

Matthieu Sévère

Member since:
11 October 2012

Posts: 34

Monday 10 August 2009 10:36:24 am

Hello,

First of all Congrats for the extension, it looks very nice :-)

Can you tell us what's the benefit of using ezjscore ?
I started to read the code and it seems that :
- it uses a new index.php that enhances performance ?
- We can call every implemented server method from javascript through ajax mechanism ?
- Can we fetch a template in ajax ?

++

--
eZ certified developer: http://ez.no/certification/verify/346216

Up

Ryad-Marcel El-Dajani

Member since:
28 July 2008

Posts: 3

Monday 10 August 2009 2:44:44 pm

Hello.
This extension seems to be the next generation of the "ezcore" extension.
The new index_ajax.php is required to implement the ajax library, but you won't find any effective disadvantage with your existing templates and extensions.
With ezcore (now ezjscore) you can implement every server-side script through ajax.
If you want to fetch a template, just do it like this in your server-side PHP script which is called through ajax:




require_once("kernel/common/template.php");


$tpl = templateInit();


$tpl->setVariable("myvar", "test_123"); // callable in "to_fetch.tpl"


$ret["html"] = $tpl->fetch("design:to_fetch.tpl");


return $ret;


Up

André R

Member since:
20 August 2005

Posts: 171

Sunday 16 August 2009 2:41:20 pm

- it uses a new index.php that enhances performance ?

Yes, but this is optional, havn't gotten around to copy / clean up the doc from ezcore yet, so for more info see there atm: http://svn.projects.ez.no/ezcore/trunk/ezcore/doc/ajax.txt

- We can call every implemented server method from javascript through ajax mechanism ?

Yes, in either jQuery, or Yui 3.0. Or your own library of choice, the 'wrapper' needed is very small, see jquery( $args ): http://svn.projects.ez.no/ezjscor...e/classes/ezjscserverfunctionsjs.php

- Can we fetch a template in ajax ?

Yes, and you can actually do it a lot easier then described above (use the above if you need to do some code in php as well though).
See the included example in http://svn.projects.ez.no/ezjscor...nsion/ezjscore/settings/ezjscore.ini




[ezjscServer_ezjsctemplate]


# Url to test this server function(return alert message):


# <root>/ezjscore/call/ezjsctemplate::alert


# will execute templates/ezjsctemplate/alert.tpl


TemplateFunction=true


# This is for permission, if it hadn't been defined, ezjsctemplate


# would have been accessible to everyone


Functions[]=ezjsctemplate


--
ar

Up

You need to be logged in to post messages in the forums. New users may register here.