Move examples into the test fixtures.
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
<h1>{{header}}</h1>
|
||||
{{#notEmpty}}
|
||||
<ul>
|
||||
{{#item}}
|
||||
{{#current}}
|
||||
<li><strong>{{name}}</strong></li>
|
||||
{{/current}}
|
||||
{{^current}}
|
||||
<li><a href="{{url}}">{{name}}</a></li>
|
||||
{{/current}}
|
||||
{{/item}}
|
||||
</ul>
|
||||
{{/notEmpty}}
|
||||
{{#isEmpty}}
|
||||
<p>The list is empty.</p>
|
||||
{{/isEmpty}}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class Complex {
|
||||
public $header = 'Colors';
|
||||
|
||||
public $item = array(
|
||||
array('name' => 'red', 'current' => true, 'url' => '#Red'),
|
||||
array('name' => 'green', 'current' => false, 'url' => '#Green'),
|
||||
array('name' => 'blue', 'current' => false, 'url' => '#Blue'),
|
||||
);
|
||||
|
||||
public function notEmpty() {
|
||||
return !($this->isEmpty());
|
||||
}
|
||||
|
||||
public function isEmpty() {
|
||||
return count($this->item) === 0;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<h1>Colors</h1>
|
||||
<ul>
|
||||
<li><strong>red</strong></li>
|
||||
<li><a href="#Green">green</a></li>
|
||||
<li><a href="#Blue">blue</a></li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user