Beispiel #1
0
    public function testNestedArray()
    {
        $p = new pui();
        $submenu = array('a', 'b');
        $menu = array($p->link('1.html', 'one'), $p->ulist()->addArray($submenu));
        $this->assertEquals($p->ulist()->addArray($menu)->asHtml(), '
<ul>
  <li><a href="1.html">one</a></li>
  <li>
    <ul>
      <li>a</li>
      <li>b</li>
    </ul>
  </li>
</ul>');
    }
Beispiel #2
0
    public function testBasic()
    {
        $p = new pui();
        $test = $p->navbar(pui::link('#')->add('BRAND!'))->add($p->link('/target.url')->add('target'), 'non-link');
        $this->assertEquals($test->asHtml(), '
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#div-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span><span class="icon-bar" /><span class="icon-bar" /><span class="icon-bar" />
      </button><a href="#">BRAND!</a>
    </div>
    <div class="collapse navbar-collapse" id="div-1">
      <ul class="nav navbar-nav">
        <li><a href="/target.url">target</a></li>
        <li>non-link</li>
      </ul>
    </div>
  </div>
</nav>');
    }
Beispiel #3
0
<?php

//use stgnet\pui;
require "pui.php";
$pui = new pui();
$lock = '<span class="glyphicon glyphicon-lock"></span>';
$menu = array($pui->link('/about.php')->addText('About'), $pui->link('/contact.php', 'Contact Us'), $pui->link('/faq.php')->add($pui->Text('FAQ')));
$menu_right = array('Admin' => array('Report ' . $lock => '/report.php'));
echo $pui->page('Very Much Longer Page Name <test>', array('lang' => 'en'))->background('blue')->add($pui->bootstrap('flatly'), $pui->navbar($pui->link('#', 'BRAND!'))->addContent($menu), $pui->heading(1, "this & that and several other things too"))->asHtml(0, True);
/* <div class="navbar navbar-default" role="navigation">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="/"><span>
			  <img src="/mmm.png" style="height:auto; width:auto; max-height:26px;">
			  Magic Music Mill
		  </span></a>
        </div>
        <div class="navbar-collapse collapse">
			<?php
				navbar($menu); 
				navbar($menu_right,'navbar-right');
			?>
        </div><!--/.nav-collapse -->
      </div>
    </div>