Back
nameLens
Table Column/Field Titles
nameLens
Sets the field titles for the grid, detail, edit, new record and search/filter screens
Default:
This allows you to place additional instructions specific to a field when editing it, a different one when creating a new record, or to shorten or rephrase a column title.

To set a blank title, use {nbsp} to set a non-breaking space.

The order of titles is

$lens->nameLens ="$colname^$title^$editTitle^$newTitle^$detailTitle^$filterTitle^$gridTitle";

If a title is not defined, then the default $title is used.

Note: $filterTitle can only be set since phpLens 2.4.7, and $gridTitle since phpLens 2.5.5.

Executing PHP Code

Prefix title with = sign, and the title will be evaluated as PHP code. In the example below, $CURRENCY is a global variable.

$lens->nameLens = 'col^="Salary ".$CURRENCY';

Incorporating Field Values in titles for EDIT or NEW forms

Since 4.2.6, you can incorporate field values in titles for the EDIT or NEW record forms. For example, for the edit form, you have a field called NAME, and you want to incorporate a field called LEGALINFO in the title of field NAME.

  Name ({LEGALINFO})

This feature also supports execution of PHP code,

  ='Name ('.{LEGALINFO}.') '. date('Y-m-d').' '.$GLOBALS['MOREINFO']

Syntax
$lens->nameLens="col1^grid^edit^new^detail;col2^grid2";

Consider a column called PHONE and we want to tell users that it accepts the format 999-9999:

nameLens="PHONE^Tel^Edit Phone (999-9999)^New Phone (999-9999)^";

If you leave a parameter blank, the column name will be used instead.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]