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
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_exports()   Adds exports
void   add_http_header()   Adds HTTP header
void   &fetch_content()   Returns page HTML
mixed   get_exported_value()   Returns value of exported pair.
array   get_http_headers()   Return HTTP headers
string   get_name()   Returns view name
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   show()   Shows page HTML

[ Top ]
Properties
TPLE_Exports   $exports [line 55]

TPLE_Exports holder

API Tags:
Access:  protected


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

HTTP headers array

API Tags:
Internal:  
Access:  protected


[ 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:  protected


[ Top ]
Methods
Constructor __construct  [line 70]

  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_exports  [line 122]

  void add_exports( $exports  )

Adds exports

Parameters:
TPLE_exports   $exports: 

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
add_http_header  [line 178]

  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 ]
fetch_content  [line 91]

  void &fetch_content( )

Returns page HTML


API Tags:
Abstract:  
Access:  public


Redefined in descendants as:

[ Top ]
get_exported_value  [line 138]

  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 188]

  array get_http_headers( )

Return HTTP headers


API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
get_name  [line 82]

  string get_name( )

Returns view name


API Tags:
Access:  public


[ Top ]
set_exported_value  [line 160]

  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 112]

  void set_exports( $exports  )

Sets TPLE exports

Parameters:
TPLE_exports   $exports: 

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
set_name  [line 199]

  void set_name( unknown_type $name  )

Sets name of the view

Parameters:
unknown_type   $name: 

API Tags:
Internal:  
Access:  private


[ Top ]
show  [line 98]

  void show( )

Shows page HTML


API Tags:
Access:  public


Redefined in descendants as:

[ Top ]