Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Utility functions

makePageLink function

Scroll Prev Next More

Description

Creates a link to any application page.

Syntax

makePageLink( $table, $pageType, $keys = null, $additionalParams = array() )

Arguments

$table

table name

$pageType

page type like "list", "add" or "edit"

$keys

an array with key columns and their values. Required when creating a link pointing to Edit or View pages.

This can be either simple array of values, like

array( 10, "JOHN")

or associative array with field names as keys:

array( "department" => 10, "last_name" => "JOHN")

When used in 'After record updated' or 'After record added' event, pass the $keys parameter of the event as is.

$additionalParams

any additional parameterss you want to add to the URL. For instance, array( "page" => "list1" ) will create a URL of the additional list page named "list1"

Return value

A link to the respective page like

Example 1

Create a link to the Cars table additional list page named list1.

 

makePageLink( "cars", "list", null, array( "page" => "list1" ))  

 

Returns cars_list.php?page=list1

 

Example 2

In 'After Record Added' event create a link to the View page of the same record.

 

makePageLink( "cars", "view", $keys )    

 

Returns cars_view.php?editid1=35

 

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software