tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Web_Ctrl

Source Location: /web_site/web_ctrl.class.php

Class Web_Ctrl

Descendants
Child Class Description
Web_Page Class Web_Page represents the abstract concept of web page

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Property Summary
Web_Site_Config   $_config   Web_Site_Config holder
Web_Context   $_context   Web_Context holder
TPLE_Exports   $_exports   TPLE_Exports holder
array   $_transit_vars   Holds variables that are added as transit

[ Top ]
Method Summary
Web_Ctrl   __construct()   Constructor
void   add_exports()   Adds exports. This is bulk version of export()
void   add_transit_var()  
void   capture_transit_vars()  
void   create_redirect_composer()  
void   export()   Adds value key-value pair exports
void   get_transit_var()  
void   get_transit_vars()  
Web_Site_Config   get__config()   Returns current web site configuration object.
Web_Context   get__context()   Returns reference to context
TPLE_Exports   get__exports()   Return exports object
void   init()   Place for user code for initialization.
void   init_transit_vars()   Here is the place to add your transit vars
void   prepare_transit_vars()  
void   remove_transit_var()  
void   run()   Put your main page functionalty in run() (if not otherwise specified like for example for WED pages)
void   set_config()   Sets $_config
void   set_context()   Sets context
void   set_transit_vars_as_output_rewrite_vars()  
void   set_transit_var_value()  
void   _init()   Initializing the page
Web_Page_View   _run()   Runs the controller

[ Top ]
Properties
Web_Site_Config   $_config [line 42]

Web_Site_Config holder

API Tags:
Internal:  
Access:  protected


[ Top ]
Web_Context   $_context [line 57]

Web_Context holder

API Tags:
Internal:  
Access:  private


[ Top ]
TPLE_Exports   $_exports [line 49]

TPLE_Exports holder

API Tags:
Internal:  
Access:  protected


[ Top ]
array   $_transit_vars = array() [line 65]

Holds variables that are added as transit

API Tags:
Internal:  
Access:  private


[ Top ]
Methods
Constructor __construct  [line 72]

  Web_Ctrl __construct( )

Constructor



Redefined in descendants as:

[ Top ]
add_exports  [line 157]

  void add_exports( $exports  )

Adds exports. This is bulk version of export()

Parameters:
TPLE_exports   $exports: 

API Tags:
Access:  public


[ Top ]
add_transit_var  [line 183]

  void add_transit_var( $var_name, [ $var_value = NULL]  )

Parameters:
   $var_name: 
   $var_value: 

API Tags:
Access:  public


[ Top ]
capture_transit_vars  [line 226]

  void capture_transit_vars( )


API Tags:
Access:  public


[ Top ]
create_redirect_composer  [line 266]

  void create_redirect_composer( $target_location, [ $param_pairs = array()]  )

Parameters:
   $target_location: 
   $param_pairs: 

API Tags:
Access:  protected


[ Top ]
export  [line 147]

  void export( string $key, string $value  )

Adds value key-value pair exports

Parameters:
string   $key: 
string   $value: 

API Tags:
Access:  public


[ Top ]
get_transit_var  [line 206]

  void get_transit_var( $var_name, [ $forgiving = false]  )

Parameters:
   $var_name: 
   $forgiving: 

API Tags:
Access:  public


[ Top ]
get_transit_vars  [line 221]

  void get_transit_vars( )


API Tags:
Access:  public


[ Top ]
get__config  [line 178]

  Web_Site_Config get__config( )

Returns current web site configuration object.


API Tags:
Return:  Current $WSC
Access:  public


[ Top ]
get__context  [line 126]

  Web_Context get__context( )

Returns reference to context


API Tags:
Access:  public


[ Top ]
get__exports  [line 136]

  TPLE_Exports get__exports( )

Return exports object


API Tags:
Access:  public


[ Top ]
init  [line 106]

  void init( )

Place for user code for initialization.

Must throw exception (TE_Page_Failed_To_Init) if init fails. On failure run() method will not be executed. Put in init() all code that:

  • checks for availability of resources
  • it is not essential for concrete page functionality
Init method is useful for base page classes - if you have some functionality that is common for all (most) pages in your site - put it here and then inherit that base page class. Don't forget to call parent::init() if you overload it


API Tags:
Access:  protected


[ Top ]
init_transit_vars  [line 312]

  void init_transit_vars( )

Here is the place to add your transit vars

This method will be called by __constructor automatically. It is provided for convenience (i.e. otherwise you have to add transit vars in __constructor which means that you have to overload it, find the correct declaration, etc.)

Example:

  1.  <?php
  2.  protected function init_transit_vars({
  3.          add_transit_var('category');
  4.  }
  5.  ?>


API Tags:
Access:  protected


[ Top ]
prepare_transit_vars  [line 254]

  void prepare_transit_vars( )


API Tags:
Access:  protected


[ Top ]
remove_transit_var  [line 247]

  void remove_transit_var( $var_name  )

Parameters:
   $var_name: 

API Tags:
Access:  public


[ Top ]
run  [line 322]

  void run( )

Put your main page functionalty in run() (if not otherwise specified like for example for WED pages)

Must return instance of Web_Page_View


API Tags:
Abstract:  
Access:  public


[ Top ]
set_config  [line 168]

  void set_config( Web_Site_Config $config  )

Sets $_config

Parameters:
Web_Site_Config   $config: 

API Tags:
Internal:  
Access:  private


[ Top ]
set_context  [line 116]

  void set_context( Web_Context $context  )

Sets context

Parameters:
Web_Context   $context: 

API Tags:
Internal:  
Access:  private


[ Top ]
set_transit_vars_as_output_rewrite_vars  [line 238]

  void set_transit_vars_as_output_rewrite_vars( )


API Tags:
Access:  public


[ Top ]
set_transit_var_value  [line 196]

  void set_transit_var_value( $var_name, $var_value  )

Parameters:
   $var_name: 
   $var_value: 

API Tags:
Access:  public


[ Top ]
_init  [line 84]

  void _init( Web_Context $context, Web_Site_Config $config  )

Initializing the page

Parameters:
Web_Context   $context: 
Web_Site_Config   $config: 

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
_run  [line 286]

  Web_Page_View _run( )

Runs the controller


API Tags:
Access:  public


[ Top ]
Constants
TRANSIT_VARS_PREFIX = '_transit_' [line 34]

[ Top ]