Trongate Website Homepage

Accessing Data in Templates

When a $data array is passed into a view file or a template, all properties of the $data array are accessible within those contexts. For example, if the $data array contains a 'name' property of 'John' and an 'age' property of 21, these details can be rendered as follows:

<?php echo $name.' '.$age; ?>

Additionally, to inspect all properties within the $data array, you can use var_dump($data), print_r($data), or Trongate's json() function within the view file or template. For example:

<?= json($data) ?>

In Summary