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

Class: Web_Page_View

Source Location: /web_site/web_page/web_page_view.class.php

Class Web_Page_View

Descendants
Child Class Description
Just_Headers_View Just_Headers_View is used to be returned by Web_Page instances when redirect is requested

[ 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
array   $additional_csses   Holds additional CSSes that will be exported to template
array   $additional_jses   Holds additional Javascript files that will be exported to template
TPLE_Exports   $exports   TPLE_Exports holder
array   $http_headers   HTTP headers array
string   $name   Name of the view
Web_Page   $page   Web_Page holder

[ Top ]
Method Summary
Web_Page_View   __construct()   Constructor
void   add_css()  
void   add_exports()   Adds exports
void   add_http_header()   Adds HTTP header
void   add_js()  
void   export()   Adds value key-value pair exports
void   &fetch_content()   Returns page HTML
void   get_additional_csses()  
void   get_additional_jses()  
mixed   get_exported_value()   Returns value of exported pair.
array   get_http_headers()   Return HTTP headers
string   get_name()   Returns view name
void   get_page()   Returns page object
TPLE_Exports   get__exports()   Returns exports object
void   init_exports()  
void   set_exported_value()   Changes the value of exported pair.
void   set_exports()   Sets TPLE exports
void   set_name()   Sets name of the view
void   set_page()   Sets page object
void   show()   Shows page HTML

[ Top ]
Properties
array   $additional_csses = array() [line 70]

Holds additional CSSes that will be exported to template

API Tags:
Access:  private


[ Top ]
array   $additional_jses [line 78]

Holds additional Javascript files that will be exported to template

API Tags:
Access:  private


[ Top ]
TPLE_Exports   $exports [line 55]

TPLE_Exports holder

API Tags:
Access:  private


[ Top ]
array   $http_headers = array() [line 48]

HTTP headers array

API Tags:
Internal:  
Access:  private


[ Top ]
string   $name [line 62]

Name of the view

API Tags:
Access:  private


[ Top ]
Web_Page   $page [line 40]

Web_Page holder

API Tags:
Internal:  
Access:  private


[ Top ]
Methods
Constructor __construct  [line 87]

  Web_Page_View __construct( Web_Page $page, [string $name = 'default']  )

Constructor

Parameters:
Web_Page   $page:  Page tha view is for
string   $name:  Name of the view


Redefined in descendants as:

[ Top ]
add_css  [line 236]

  void add_css( $path_to_css_file  )

Parameters:
   $path_to_css_file: 

API Tags:
Access:  public


[ Top ]
add_exports  [line 165]

  void add_exports( $exports  )

Adds exports

Parameters:
TPLE_exports   $exports: 

API Tags:
Access:  public


[ Top ]
add_http_header  [line 221]

  void add_http_header( unknown_type $http_header  )

Adds HTTP header

Parameters:
unknown_type   $http_header: 

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
add_js  [line 246]

  void add_js( $path_to_js_file  )

Parameters:
   $path_to_js_file: 

API Tags:
Access:  public


[ Top ]
export  [line 262]

  void export( string $key, string $value  )

Adds value key-value pair exports

Parameters:
string   $key: 
string   $value: 

API Tags:
Access:  public


[ Top ]
fetch_content  [line 131]

  void &fetch_content( )

Returns page HTML


API Tags:
Abstract:  
Access:  public


Redefined in descendants as:

[ Top ]
get_additional_csses  [line 241]

  void get_additional_csses( )


API Tags:
Access:  public


[ Top ]
get_additional_jses  [line 251]

  void get_additional_jses( )


API Tags:
Access:  public


[ Top ]
get_exported_value  [line 181]

  mixed get_exported_value( string $key, [boolean $forgiving = true]  )

Returns value of exported pair.

If $forgiving is set to false will throw exception TE_Key_Not_Exists if such key does not exist. If $forgiving is set to true will return NULL if such key does not exist.

Parameters:
string   $key: 
boolean   $forgiving: 

API Tags:
See:  Web_Page_View::set_exported_value()
Access:  public


[ Top ]
get_http_headers  [line 231]

  array get_http_headers( )

Return HTTP headers


API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
get_name  [line 112]

  string get_name( )

Returns view name


API Tags:
Access:  public


[ Top ]
get_page  [line 102]

  void get_page( )

Returns page object


API Tags:
Access:  public


[ Top ]
get__exports  [line 122]

  TPLE_Exports get__exports( )

Returns exports object


API Tags:
Access:  public


[ Top ]
init_exports  [line 94]

  void init_exports( )


API Tags:
Access:  protected


[ Top ]
set_exported_value  [line 203]

  void set_exported_value( string $key, mixed $value, [ $create_if_not_exist = false], boolean $create_if_not_exists  )

Changes the value of exported pair.

If $create_if_not_exists is set to true this function will create export pair if it does not exist. If $create_if_not_exists is set to false exception will be thrown if pair does not exist.

The purpose of methods set_exported_value and get_exported_value is to give chance to the view class to format values. For example, if Page object exported 'total' => 0.54, view object can use number_format() function to change the appearance of the value (first it will get value with $var = get_exported_value('some_key'), then will set_exported_value('some_key', number_format($var, 2, ','))).

Parameters:
string   $key: 
mixed   $value: 
boolean   $create_if_not_exists: 
   $create_if_not_exist: 

API Tags:
Access:  public

Information Tags:
Throws:  TE_Key_Not_Exists

[ Top ]
set_exports  [line 155]

  void set_exports( $exports  )

Sets TPLE exports

Parameters:
TPLE_exports   $exports: 

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
set_name  [line 274]

  void set_name( string $name  )

Sets name of the view

Parameters:
string   $name: 

API Tags:
Internal:  
Access:  private


[ Top ]
set_page  [line 288]

  void set_page( Web_Page $page  )

Sets page object

Parameters:
Web_Page   $page: 

API Tags:
Access:  private


[ Top ]
show  [line 138]

  void show( )

Shows page HTML


API Tags:
Access:  public


Redefined in descendants as:

[ Top ]