Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

ezjscore server functions reference

The settings of an ezjscore server function block, the call address and answer, the ezjscore/call policy, the server functions the kernel ships, and the JavaScript clients.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/extension-development/part-8-reference/ezjscore-server-functions-reference.md

On this page

ezjscore server functions reference

Part 8, reference 19. A server function is a PHP method the browser can call through /ezjscore/call/... and get JSON back. Building one is explained in Ajax with ezjscore server functions and the tutorial An Ajax server function, by hand. This page lists the settings, the built-in functions and the clients.

The settings block

In your extension's settings/ezjscore.ini.append.php, one block per server name:

KeyMeaning
[ezjscServer_<name>]the block; <name> is the server name used in calls
Classthe class whose public static methods are the functions (extends ezjscServerFunctions)
Filethe class's file, when it is not autoloaded
TemplateFunction=truethe functions are templates, templates/<name>/<function>.tpl, instead of PHP methods
Functions[]the function list names this block belongs to, used by the ezjscore/call policy's limitation
RequirePolicyenabled: callers also need the ezjscore/call policy for this function list
HardLimit(ezjscnode only) the most items a subtree call returns

The address

<root>/ezjscore/call/<server>::<function>[::<arg1>[::<arg2> ...]]

The parts after the function name arrive in $args. POST data is read with eZHTTPTool in the method. The answer, with an Accept: application/json header, is {"error_text":"...","content":...}.

Access

  • Every call needs the policy ezjscore/call; its limitation FunctionList names the function lists a role may call.
  • Each function must still check what it does: a function that reads content checks that the user can read it; one that changes data requires POST and the form token (ezformtoken and CSRF).
  • The kernel's ezjscnode functions are readable by anyone who may read the node unless RequirePolicy=enabled; backend ezjscore services explains the switch.

Server functions the kernel ships

CallReturns
ezjsc::timethe server time (a quick test)
ezjscnode::subtree::<nodeID>[::<limit>::<offset>...]a node list as JSON
ezjsctemplate::<template>a template rendered as the answer
expsubitems::columns::<nodeID>, expsubitems::rows::...the admin sub-items table's data
expdebugbar::...the debug bar's functions (settings, caches, log)

The comments of extension/ezjscore/settings/ezjscore.ini give each block's test address.

Clients

ClientLoaded withCall
Exponential UIexp::io (on every admin page)Exp.io.call( 'myserver::myfunction', [ arg1 ], { data: { ... } } ) returns a Promise; POST by default
jQueryezjsc::jquery, ezjsc::jqueryio$.ez( 'myserver::myfunction::arg1', postData, callback )

Both send the form token with POST requests from pages that carry it.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x