by ewsplat · 14y ago · 0 comments
I wonder if you found the lack of relational data an obstacle? Maybe not now but do you see it being a problem down the road?
// class Accounts ...
'orders' => function ($account) {
return get("/orders", [account_id => $account['id']]);
}
Get an account, access the relationship: {get $account from "/accounts/123"}
You have {pluralize "{$account.orders.count} orders"}
{foreach $account.orders as $order}
...
{/foreach}
This also works as expected: {get $orders from "/accounts/123/orders"}
It would be cool if you built your platform on Forward. Just sayin' :)