Frontend\Core\Engine\Page::display PHP Method

display() public method

Display the page
public display ( )
    public function display()
    {
        // assign the id so we can use it as an option
        $this->tpl->addGlobal('isPage' . $this->pageId, true);
        $this->tpl->addGlobal('isChildOfPage' . $this->record['parent_id'], true);
        // hide the cookiebar from within the code to prevent flickering
        $this->tpl->addGlobal('cookieBarHide', !$this->get('fork.settings')->get('Core', 'show_cookie_bar', false) || CommonCookie::hasHiddenCookieBar());
        // the the positions to the template
        $this->parsePositions();
        // assign empty positions
        $unusedPositions = array_diff($this->record['template_data']['names'], array_keys($this->record['positions']));
        foreach ($unusedPositions as $position) {
            $this->tpl->assign('position' . \SpoonFilter::ucfirst($position), array());
        }
        // parse header
        $this->header->parse();
        // parse breadcrumb
        $this->breadcrumb->parse();
        // parse languages
        $this->parseLanguages();
        // parse footer
        $this->footer->parse();
        // output
        return new Response($this->tpl->getContent($this->templatePath), $this->statusCode);
    }

Usage Example

Beispiel #1
0
 /**
  * @return Response
  */
 public function display()
 {
     return $this->page->display();
 }