FrameBeurk documentation

6. Features

6.1. URI rewriting

(See Miscellaneous for a thought about the word "URI")

To activate URI rewriting, the configuration parameter « UrlRewriting » must be set to true, and the .htaccess file -if Apache is used, should be properly set up (see Miscellaneous too).

The requests usually destined to index.php and ajax.php are therefore redirected towards interpreteur.php which analyses the URL and fill in the PHP array of parameters : $_REQUEST[]. The rules for constructing the rewrited URI are sketches underneath :


6.2. Ajax browsing

In the case of an Ajax browsing, the history of pages stays available by Back / Forward buttons, still with transparent Ajax browsing. In order to do so, the client gets the canonical URL from the server response and stores it into javascript object « history ».

Therefore, the technical blocks (Maj action, DivVue...) of the full URI are never shown is the address bar of the browser, as long as the website uses Ajax -whether URI rewriting if activated or not.

6.3. Tag enhancement

Ajax browsing uses a more general feature of the framework that is intented to associate a behavior to an element displayed on the page, without having Javascript code included in the HTML code : This is the tag enhancement.
It uses the ability of HTML to define additional attributes. The principle of functioning is the following :

For example, to manage the Ajax browsing, the configuration is :

$CONFIG['Tissage']['Beurk']['Attribut']['data-ajax'] = 'beurk_lienAmeliore';

For a link to a Vue which will display a form before a Maj action, the code of a page would be :

<a href="/forum2/modifie-Commentaire-148" data-ajax="modifieCommentaire148" >Edit...</a>

When the user clicks on a link having the attribute data-ajax, function « beurk_lienAmeliore » reads the content of the attribute to determine which div will display the result of the Ajax request. Hence, the function rebuilds the URI from the content of attributes data-ajax and href.

6.4. DB communication layer

To give to this framework an interface independant from the used SQL database, a communication layer brings « front-end » functions to the standard one of interface mysql (or mysqli), with mainly 2 improvements :

array( 'SELECT' => array('S.IdSection', 'S.Section', 'S.NbrSujets', 'S.NbrSujetsArchives',                      'S.IdCreateur', 'U.User', 'S.TsCRE', 'S.TsMAJ', 'S.Etat'),    'FROM' => 'Rhum_Section AS S '              . 'LEFT JOIN Uzers_User AS U ON S.IdCreateur = U.IdUser '    'WHERE' => "S.IdSection = '$IdSection'");

Using array-requests is not mandatory, except in the case of calling Permissions (this feature is described in the next chapter).



© 2010-2015 by ToolOscope SASU. © 2016-2018 by Arnaud De Rette. All rights reserved