Esempio n. 1
0
 /**
  * Render the object into a string.
  *
  * @return mixed
  */
 public function render()
 {
     $title = 'Illuminated';
     $dashboardUrl = $this->context->url();
     $modulesUrl = $this->context->method('illuminated.conference.front', 'modules');
     $modulesDropdown = Std::foldr(function (NavbarDropdownFactory $factory, Module $module) {
         return $factory->addOption($this->context->module($module->getName()), $module->getLabel());
     }, new NavbarDropdownFactory(), $this->dashboard->getModules())->setContent([new Italic(['class' => 'fa fa-rocket']), ' Launchpad'])->make();
     $innerPage = new Page([new Container(['class' => 'p-t p-b'], [new Navigation(['class' => 'navbar navbar-dark bg-inverse'], [new Anchor(['class' => 'navbar-brand', 'href' => $dashboardUrl], 'Illuminated'), new UnorderedList(['class' => 'nav navbar-nav'], [new ListItem(['class' => 'nav-item'], new Anchor(['href' => $dashboardUrl, 'class' => 'nav-link'], 'Home')), $modulesDropdown, new ListItem(['class' => 'nav-item'], new Anchor(['href' => $modulesUrl, 'class' => 'nav-link'], [new Italic(['class' => 'fa fa-asterisk']), ' Meta']))])])]), $this->renderContent(), new Container(['class' => 'p-t p-b'], [new Paragraph([], [new Small([], 'Keep building awesome stuff. 👍 ')])]), new Script(['src' => 'https://ajax.googleapis.com/ajax/libs/jquery/' . '2.1.4/jquery.min.js']), new Script(['src' => 'https://cdn.rawgit.com/twbs/bootstrap/v4-dev/' . 'dist/js/bootstrap.js'])], [new Meta(['charset' => 'utf-8']), new Meta(['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1']), new Meta(['http-equiv' => 'x-ua-compatible', 'content' => 'ie=edge']), new Title([], 'Illuminated - Conference'), new Link(['rel' => 'stylesheet', 'href' => 'https://maxcdn.bootstrapcdn.com/bootstrap' . '/4.0.0-alpha.2/css/bootstrap.min.css']), new Link(['rel' => 'stylesheet', 'href' => 'https://maxcdn.bootstrapcdn.com/font-awesome' . '/4.5.0/css/font-awesome.min.css']), new Link(['rel' => 'stylesheet', 'href' => $dashboardUrl . '/css/main.css'])]);
     return $innerPage->render();
 }
Esempio n. 2
0
 public function testFoldr()
 {
     $input = ArrayList::of([1, 2, 3, 4, 5]);
     $inputChars = ArrayList::of(['h', 'e', 'l', 'l', 'o']);
     $sum = function ($x, $y) {
         return $x + $y;
     };
     $concat = function ($x, $y) {
         return $x . $y;
     };
     $this->assertEquals(10 + 5 + 4 + 3 + 2 + 1, Std::foldr($sum, 10, $input));
     $this->assertEquals('hello---', Std::foldr($concat, '---', $inputChars));
 }