Débutant en PHP... j ene suis pas convaincu de bien faire, pouvez-vous me confirmer que c'est bon ou m'indiquer mes erreurs ?
Merci d'avance...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
	private $properties = array() ;
 
	function __array_get($array, $property)
	{	return( (isset($this->properties[$array][$property])) ? $this->properties[$array][$property] : NULL ) ; }
 
	function __array_set($array, $property, $value)
	{	$this->properties[$array][$property] = $value ; }
 
	function __get($property)
	{//	user_error("__get used[".$property."][".$this->properties[$property]."]" , E_USER_NOTICE) ;
		return( $this->properties[$property]) ; }
 
	function __set($property, $value)
	{//	user_error("__set used[".$property."]" , E_USER_NOTICE) ;
		$this->properties[$property] = $value ; }
j'utilise des constantes définies de la sorte:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
define ("DEBUG" 	, "debug" ) ;
define ("SCREEN" 	, "screen"  ) ;
define ("TITLE" 	, "title"   ) ;
define ("SUBTITLE" 	, "subtitle") ;
define ("FORM" 		, "form"    ) ;
define ("MENU" 	    , "menu" 	) ;
define ("SUBMENU" 	, "submenu" ) ;
define ("KLIMSG" 	, "klimsg"  ) ;
et j'exploite ainsi....

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
		$row = $this->screen->get_row() ;
//									$this->strip_array($this->definition) ;
		print_r($row);
//									print_r($this->definition) ;
 
		$this->__set(SCREEN 	, $row[SCREEN	]) ;
		$this->__set(TITLE  	, $row[TITLE	]) ;
		$this->__set(SUBTITLE	, $row[SUBTITLE	]) ;
		$this->__set(FORM		, $row[FORM		]) ;
		$this->__set(MENU		, $row[MENU		]) ;
		$this->__set(SUBMENU	, $row[SUBMENU	]) ;
		$this->__set(KLIMSG		, $row[KLIMSG	]) ;
Mon problème est que j'ai dans le llog PHP....

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
[20-Apr-2010 17:46:25] PHP Notice:  Undefined index: debug in F:\WebSites\jecrapahute\class\skeleton.php on line 158
[20-Apr-2010 17:46:25] PHP Notice:  Undefined index: debug in F:\WebSites\jecrapahute\class\skeleton.php on line 158
[20-Apr-2010 17:46:25] PHP Notice:  Use of undefined constant ACCUEIL - assumed 'ACCUEIL' in F:\WebSites\jecrapahute\submenu\index.php on line 10
[20-Apr-2010 17:46:25] PHP Notice:  ===> doc[] & submenu[] are required !!!! in F:\WebSites\jecrapahute\config\html.php on line 217
[20-Apr-2010 17:46:25] PHP Notice:  Undefined index: debug in F:\WebSites\jecrapahute\class\skeleton.php on line 158
[20-Apr-2010 17:46:25] PHP Notice:  Undefined index: debug in F:\WebSites\jecrapahute\class\skeleton.php on line 158
la ligne 158 est celle du return de __get ....

Pige pas....

Merci de votre coup de main

Esteban