$test1
is a mapper object, not an array.
Therefore, your template should look like:
<li>{{@result->name}} : {{@result->age}}</li>
NB: you should not confuse the mapper load
and find
methods. The load
method hydrates the current mapper object with one record. The find
method returns an array of mapper objects. E.g:
- The effect of
$test1->load('id=1')
is to map the object$test1
with the database row id 1. - The effect of
$list=$test1->find("name LIKE 'A%'")
is to return an array of mappers whose name start with a A