VIEW_DATAFEED

[[VIEW_DATAFEED]]

Populates the current datafeed variables and their values to an associative view matrix ($TerraDctl_view) where it’s rows may be more easily sorted, paginated and displayed. The view matrix is created with element labels corresponding to the datafeed’s column names within each row. Use after LOAD_DATAFEED .

Test the $TerraDctl_view matrix with a php variable dump:

[[LOAD_DATAFEED:csv_datafeed.txt]]
[[VIEW_DATAFEED]]
<?php var_dump($TerraDctl_view); ?>

Results for csv_datafeed.txt:

array(3) {
  [1]=>
  array(4) {
    ["name"]=>
    string(10) "Washington"
    ["id"]=>
    string(1) "1"
    ["color"]=>
    string(4) "blue"
    ["size"]=>
    string(3) "big"
  }
  [2]=>
  array(4) {
    ["name"]=>
    string(6) "Oregon"
    ["id"]=>
    string(1) "2"
    ["color"]=>
    string(7) "green"
    ["size"]=>
    string(5) "small"
  }
  [3]=>
  array(4) {
    ["name"]=>
    string(10) "California"
    ["id"]=>
    string(1) "3"
    ["color"]=>
    string(3) "red"
    ["size"]=>
    string(4) "huge"
  }
}

To manually populate the view matrix using php:

$TerraDctl_view = array(
array("name"=>"Washington","id"=>1,"color"=>"blue","size"=>"big"),
array("name"=>"Oregon","id"=>2,"color"=>"green","size"=>"small"),
array("name"=>"California","id"=>3,"color"=>"red","size"=>"huge"));

See also: VIEW_SORT, LOAD_DATAFEED, SAVE_DATAFEED.

Leave a Reply