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

Class: Web_Page

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

Class Web_Page

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
string   $page_name   Page name
string   $page_url_name   current URL of the page
array   $views   Views for this page. Array of Web_Page_View
Web_Site_Config   $_config   Web_Site_Config holder
Web_Context   $_context   Web_Context holder

[ Top ]
Method Summary
Web_Page   __construct()   Constructor
void   add_view()   Adds view
string   capture_page_url_name()   Captures current URL from context
void   export()   Alias of $this->exports->add_pair()
Web_Context   get_context()   Returns reference to context
string   get_page_name()   Returns page name
unknown   get_page_url_name()   Returns page URL
Web_Page_View   get_view()   Returns view
void   init()   Place for user code for initialization.
Web_Context   query_context()   Returns context
void   run()   Put your main page functionalty in run() (if not otherwise specified like for example for WED pages)
void   set_context()   Setsd context
void   set_page_name()   Sets page name
void   _init()   Initializing the page
unknown   _run()   Runs the page

[ Top ]
Properties
TPLE_Exports   $exports [line 64]

TPLE_Exports holder

API Tags:
Internal:  
Access:  protected


[ Top ]
string   $page_name [line 79]

Page name

API Tags:
Internal:  
Access:  private


[ Top ]
string   $page_url_name [line 92]

current URL of the page

API Tags:
Access:  private


[ Top ]
array   $views = array() [line 86]

Views for this page. Array of Web_Page_View

API Tags:
Internal:  
Access:  private


[ Top ]
Web_Site_Config   $_config [line 57]

Web_Site_Config holder

API Tags:
Internal:  
Access:  protected


[ Top ]
Web_Context   $_context [line 72]

Web_Context holder

API Tags:
Internal:  
Access:  private


[ Top ]
Methods
Constructor __construct  [line 100]

  Web_Page __construct( string $page_name  )

Constructor

Parameters:
string   $page_name: 


[ Top ]
add_view  [line 198]

  void add_view( Web_Page_View $page_view  )

Adds view

Parameters:
Web_Page_View   $page_view: 

API Tags:
Access:  protected

Information Tags:
Throws:  TE_Web_Page_View_Already_Exists

[ Top ]
capture_page_url_name  [line 231]

  string capture_page_url_name( )

Captures current URL from context


API Tags:
Internal:  
Access:  private


[ Top ]
export  [line 283]

  void export( string $key, string $value  )

Alias of $this->exports->add_pair()

Parameters:
string   $key: 
string   $value: 

API Tags:
Access:  public


[ Top ]
get_context  [line 262]

  Web_Context get_context( )

Returns reference to context


API Tags:
Access:  public


[ Top ]
get_page_name  [line 160]

  string get_page_name( )

Returns page name


API Tags:
Access:  public


[ Top ]
get_page_url_name  [line 170]

  unknown get_page_url_name( )

Returns page URL


API Tags:
Access:  public


[ Top ]
get_view  [line 214]

  Web_Page_View get_view( string $name  )

Returns view

Parameters:
string   $name:  Name of the view

API Tags:
Access:  protected

Information Tags:
Throws:  TE_Web_Page_View_Not_Exists

[ Top ]
init  [line 134]

  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:  public


[ Top ]
query_context  [line 272]

  Web_Context query_context( )

Returns context


API Tags:
Access:  public


[ Top ]
run  [line 152]

  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_context  [line 252]

  void set_context( Web_Context $context  )

Setsd context

Parameters:
Web_Context   $context: 

API Tags:
Internal:  
Access:  private


[ Top ]
set_page_name  [line 183]

  void set_page_name( string $page_name  )

Sets page name

Parameters:
string   $page_name: 

API Tags:
Internal:  
Access:  private

Information Tags:
Throws:  Tangra_Exception
Throws:  Tangra_Exception

[ Top ]
_init  [line 112]

  void _init( Web_Context $context, Web_Site_Config $config  )

Initializing the page

Parameters:
Web_Context   $context: 
Web_Site_Config   $config: 

API Tags:
Access:  public


Implementation of:
I_Runnable_By_Site::_init()
Web_Site will call _init prior to _run in order object to have the chance to initialize all required resources

[ Top ]
_run  [line 143]

  unknown _run( )

Runs the page


API Tags:
Access:  public


Implementation of:
I_Runnable_By_Site::_run()
Web_Site will use _run to run the object

[ Top ]