Section: Request object

−
Table of content

A jRequest object handles the processing of the input data in order to make it easily available to the framework and especially to the actions. It allows, among other things, to determine the actions to execute.

There are several types of jRequest objects, processing different input data. Indeed, we don't retrieve the input data for a HTML page (in the url (get) or encoded in the body of the HTTP request (post) ), the same way as we would do for a XML-RPC request (data in the body of the HTTP request in XML).

For each jRequest object, corresponds one or more authorized output format, then one or more authorized jResponse object.

The available jRequest object are :

classic : for the classical requests whose response type is not important (html, text, redirection ..)

It should exist an entry point for each type of request that you want to use. For the classic (so index.php), it looks like this:

// include the main application file
// which includes itself jelix files
require_once ('../../myapp/application.init.php');
// include the request objet you want to use
require_once (JELIX_LIB_CORE_PATH.'request/jClassicRequest.class.php');
// Let's define the configuration file for this entry point
// Here the file is stored in var/config/index/
$config_file = 'index/config.ini.php';
// Let's go !
$jelix = new jCoordinator($config_file);
$jelix->process(new jClassicRequest());

This manual is distributed under the terms of licence Creative Commons by-nc-sa 3.0. Therefore you're allowed to copy, modify and distribute and transmit it publicly under the following conditions: Attribution, Noncommercial, Share Alike.