Page life cycle overview Home

Introduction
Welcome
System requirements
Licensing details
What is the registration
Using PHPRunner
Working with projects
Templates
What are templates
Cars
Classified ads
Events
Jobs
Knowledge base
News
Paypal
Real estate
Sporting
Vacation houses
Connecting to the database
Datasource tables
SQL query page
About SQL query designer
Query Designer
SQL
Results
Charts
Creating chart and setting parameters
Chart appearance
Using SQL to shape chart data
Reports
Creating report and setting parameters
Report totals and layout
Choose pages
Login page
User login settings
Advanced security settings
User group permissions
Fields order and totals
Miscellaneous settings
Choose theme
Visual Editor
About
Toolbars
Page Elements
"View as" settings
"Edit as" settings
Validation types
Lookup wizard
Events
Output directory settings
After you are done
FTP upload
FrontPage Publishing
Advanced topics
Events
More info about events
Global events
Table events
Page life cycle overview
Predefined actions
Send a simple email
Send an email with new data
Save new data in another table
Insert a record into another table
Check to see if a specific record exists
Display a message on the Web page
Redirect to another page
Custom code
Sample events
Show list of customer orders
Check if start date is ealier than end date
Before deleting a record check for related records
Speed up data entry using events
Publishing PHP application to the remote Web server
Using FTP client to publish PHP pages to the remote Web server
Using FrontPage to publish PHP pages to the remote Web server
Demo Account
What is the Demo Account?
Terms and Conditions
Connect using PHP
Master-details relationships
Using JOIN SQL queries
AJAX-based Functionality
PHPRunner session variables
Debugging tips
Template files processing rules (Files.txt)
Multilanguage support
Useful functions and links
Smarty templates
Stylesheets
Template language
How to control Inline Add/Edit functionality from script
Rich Text Editor plugins
Upgrade Guide from PHPRunner 3.0 and older
PDF view settings
Order PHPRunner online

 
 PHPRunner manual


Page life cycle overview

When a PHPRunner-generated page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization, retrieving data, instantiating controls and rendering. It is important to understand the page life cycle so that you can write code at the appropriate life-cycle stage for the effect you intend.

 

List/Print pages

BeforeProcessList

BeforeProcessPrint

 

Occurs when page processing starts and database connection is established.

Use this event for the following:

- change database connection to point to another database

- read request data and populate session variables

- redirect to another page

BeforeDelete

This event will be executed once for each record to be deleted.

Use this event for the following:

- prevent a record from being deleted

- save deleted record in another table

 

AfterDelete

Occurs once for each record after it was deleted

AfterMassDelete

Occurs after bulk delete opearation

BeforeQueryList

BeforeQueryPrint

Occurs right before SQL query that retrieves data is executed. Use this event to modify SQL query i.e. to add an additional filter (WHERE clause).

BeforeProcessRowList

BeforeProcessRowPrint

Occurs after database record is retrieved from the database before formatting is applied.

Use this event for the following:

- modify value of any column

- prevent certain records from being displayed on the page

- calculate/display your own totals and subtotals

BeforeMoveNextList

BeforeMoveNextPrint

Occurs after database record is retrieved from the database and formatting is applied.

Use this event for the following:

- display an empty row or a header between group of records.

- apply additional formatting to any column

 

BeforeShowList

BeforeShowPrint

Ocurrs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new Smarty variable or change the value of existing one

- display different template

 

Edit/Add pages

BeforeProcessEdit

BeforeProcessAdd

Ocurrs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new Smarty variable or change the value of existing one

- display different template

BeforeEdit

BeforeAdd

Occurs before new data is written to the database.

Use this event for the following:

- prevent data record from being added or edited

- send an email

- save old record in another table

- add a record to the log table

AfterEdit

AfterAdd

Occurs after data was written to the database.

Use this event for the following:

- send an email

- add a record to the log table

BeforeQueryEdit

Occurs right before SQL query that retrieves data is executed. Use this event to implement additional security i.e. set SQL query to empty string if for any reason editing is not allowed at this moment.

BeforeShowEdit

BeforeShowAdd

Ocurrs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new Smarty variable or change the value of existing one

- display different template

 

Login/Registration pages

BeforeProcessLogin

BeforeProcessRegister

Ocurrs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new Smarty variable or change the value of existing one

- display different template

BeforeLogin

BeforeRegister

Occurs before user logs in or new user data is written to the database.

Use this event for the following:

- prevent user from being logged in or registered

- send an email

- add a record to the log table

 

AfterSuccessfulLogin

AfterSuccessfulRegistration

Occurs after user is logged in or registered successfully.

Use this event for the following:

- redirect user to another page

- send an email

- add a record to the log table

 

AfterUnsuccessfulLogin

AfterUnsuccessfulRegistration

Occurs if user was not logged in or was not registered.

 

BeforeShowLogin

BeforeShowRegister

Ocurrs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new Smarty variable or change the value of existing one

- display different template

 

View/Search/Report pages

  1. BeforeProcess<PageName>

  2. BeforeQuery<PageName>

  3. BeforeShow<PageName>

 

 

 

The CHM file was converted to HTML by chm2web software.