« Programmation PHP/Exemples/MiniCMS/Développement » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 8 :
*Implémentation
 
=== *Déploiement de la vue ===
 
*Config.inc.php
<source lang="php">
<?php
 
/**
* configure my tiny CMS
*/
 
define("ROOT","") ;
 
define("CMS" ,ROOT."/Cms") ;
define("OWN" ,ROOT."/Owners") ;
 
define("CLA" ,CMS . "/Classes") ;
define("FUN" ,CMS . "/Functions") ;
 
//
define("OBJ" ,CMS . "/Objects") ;
 
define("BCK" ,OBJ . "/Backend") ;
define("FNT" ,OBJ . "/Frontend") ;
 
?>
</source>
 
 
*main.php
:point d'entrée back&front end
:un switch distingue les appels entrants avec et sans paramètres
<source lang="php">
<?php
 
require_once "./config.inc.php" ;
 
if( !@$_REQUEST['qry'] )
/*
* output type switch for ajax layer
*/
{
include_once FNT."/entry.inc.php" ;
}
else
{
include_once BCK."/responder.inc.php" ;
}
 
?>
</source>
 
 
*responder.inc.php
:appels entrant avec interrogation
<source lang="php">
<?php
# TESTING 1.0
echo $_REQUEST["id"] . "~@~" . $_REQUEST['id'] . " / " . $_REQUEST["name"] . " " . $_REQUEST["surname"] ;
?>
</source>
 
 
*entry.inc.php
:appels entrant sans interrogation
<source lang="php">
<?php
 
//
//require_once CLA . "/dataManager.class.php" ;
require_once CLA . "/utilities.class.php" ;
require_once CLA . "/templateControler.class.php" ;
 
//
$tmp = new templateControler(array("path"=>"./Owners/Root/Templates/default.xml"));
 
# STATE
$tmp->initFrame(
$tmp
->getNode("//template/frameset/content")
) ;
$tmp->getAnchors( $tmp->data['feed'][0]->nodeValue ) ;
$tmp->anchorContentReplacer() ;
$tmp->setFrame() ;
 
# OUTPUT
echo $tmp->data['frameset'] ;
 
?>
</source>
 
=== Ajaxification ===