Jump to content

AtkDummyAttribute

From NusaATK
Revision as of 07:12, 13 December 2007 by Sams90 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

it is possible to use this attribute among other things to give a dynamic non edit field. a none dynamic string from other attributes should use atkParserAttribute instead.

for example:

$this->add(new atkAttribute("first_name", AF_HIDE_LIST|AF_FORCE_LOAD)); $this->add(new atkAttribute("last_name", AF_HIDE_LIST|AF_FORCE_LOAD)); $this->add(new atkDummyAttribute("name_citation"));

function name_citation_display($record) {

 if (strlen($record["last_name"]) <> 0) {
   $string = $record["last_name"] . ", ". $record["first_name"];
 } else { 
   $string = $record["first_name"];
 }
 
 return $string;

}

from a table of: John | Doe Jane |

This should produce: Doe, John Jane