Skip to content

Instantly share code, notes, and snippets.

@g105b
Created September 19, 2019 10:26
Show Gist options
  • Save g105b/7462e87619b10a56e031a7eca30aab89 to your computer and use it in GitHub Desktop.
Save g105b/7462e87619b10a56e031a7eca30aab89 to your computer and use it in GitHub Desktop.
Binding nested lists example
<p>More bind examples</p>
<p>Nested list example:</p>
<ul>
<li data-template>
<p data-bind:text>Make name</p>
<ul>
<li data-template data-bind:text>Model name</li>
</ul>
</li>
</ul>
<?php
namespace App\Page;
use Gt\WebEngine\Logic\Page;
class IndexPage extends Page {
public function go() {
$data = [
"Fiat" => [
"500",
"Bravo",
"punto",
],
"Toyota" => [
"Corolla",
"Auris",
"Prius",
],
"VW" => [
"Beetle",
"Polo",
"golf"
]
];
$this->document->bindList($data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment