Adventure,PHP,framework,page controller,front controller,pattern,object orientated design,software,development,reusability,uml,tutorial,benchmark,brilliant performance,

Search:    
Downloads  |  SVN!  |  Roadmap  |  Forum!  |  Bugtracking  |  Guestbook  |  Backlinks!  |  References!  |  Sitemap  |  Impress  
 
Deutsch | English Adventure PHP Framework  Bookmark @ Technorati Bookmark @ del.icio.us Bookmark @ Mr. Wong Bookmark @ Simpy Bookmark @ Google Bookmark @ Digg.com Adventure PHP Framework Print page 021-Class-reference-table-variablenhandler

Class reference table - variablenHandler

Rank article:
This article has not yet been ranked. Vote this article first of all!
The class variablenHandler is used to register variables from the REQUEST locally. In this case, default values can be assigned to form the execution of a program more savely and more deterministic. This particular makes sense in applications with check box fields or other sequence control variables. Besides, the variablenHandler accesses the super global array $_REQUEST and extracts the offset contained there in a locally used array. The variable $_LOCALS is usually used to mark that the contents were provided with the variablenHandler component and do not correspond to the global array. The following example shows how the values of "action" and "subaction" are extracted into the array $_LOCALS and "action" is preset with the default value "none", if it was not included in the request:
   $_LOCALS variablenHandler::registerLocal(array(
                                                    
'Action' => 'none',
                                                    
'Subaction' => 'none'
                                                    
)
                                              ); 
With the use of the variablen handler it is always made sure that the locally registered variables are available. A check like
   if(isset($_REQUEST['Action'])){

      
// ... //

    // end if
   
is not necessary any more. To use this class it must be imported by
  import('tools::variablen','variablenHandler'); 
prior to use.


Comments

Do you want to add a comment to the article above, or do you want to post additional hints? So please click here. Comments already posted can be found below.


There are no comments belonging to this article.


Powered by WebRing.