示例#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();
 }
 /**
  * Render the launch bar.
  *
  * @param DashboardInterface $dashboard
  * @param ConferenceContext $context
  *
  * @return Div
  */
 protected function renderLaunchpad(DashboardInterface $dashboard, ConferenceContext $context)
 {
     return new Div(['class' => 'card-columns'], [new Div(['class' => 'card-stack'], Std::map(function (Module $module) use($context) {
         return new Div(['class' => 'card'], [new Div(['class' => 'card-block'], [new Anchor(['href' => $context->module($module->getName())], [new HeaderFour(['class' => 'card-title'], [$module->getLabel(), new Italic(['class' => 'pull-right fa ' . $module->getIcon()])])]), new Paragraph(['class' => 'card-text'], $module->getDescription()), new Paragraph(['class' => 'card-text'], new Small(['class' => 'text-muted'], [$module->getName()]))])]);
     }, $dashboard->getModules()))]);
 }