コード例 #1
0
ファイル: PaginationTest.php プロジェクト: sledgehammer/mvc
    public function test_pagination()
    {
        $pager = new Pagination(2, 1, array('href' => '#page'));
        $this->assertEquals(\Sledgehammer\component_to_string($pager), '<div class="pagination"><ul>
	<li class="active"><a href="#page1">1</a></li>
	<li><a href="#page2">2</a></li>
	<li><a href="#page2">&raquo;</a></li>
</ul></div>', 'Pagination should not render a prev button');
    }
コード例 #2
0
ファイル: Element.php プロジェクト: sledgehammer/mvc
 public function __toString()
 {
     try {
         return \Sledgehammer\component_to_string($this);
     } catch (Exception $e) {
         \Sledgehammer\report_exception($e);
         return '';
     }
 }
コード例 #3
0
ファイル: FormTest.php プロジェクト: sledgehammer/mvc
 public function test_render_with_labels()
 {
     $form = new Form(['fieldset' => false, 'fields' => ['key1' => new Input(['name' => 'field1', 'label' => 'Label1'])]]);
     $this->assertSame("<form method=\"post\">\n\t<label>Label1</label><input name=\"field1\" />\n</form>", \Sledgehammer\component_to_string($form));
 }
コード例 #4
0
ファイル: Button.php プロジェクト: sledgehammer/mvc
 public function __toString()
 {
     return \Sledgehammer\component_to_string($this);
 }