Example #1
0
 public function __construct($template = null, MAbstractViewController $parent = null)
 {
     parent::__construct($template, $parent);
     $this->items = new MDropDownListItemList($this);
 }
 protected function render()
 {
     parent::render();
     // If the master page is not set, render the page.
     if ($this->masterPage == null) {
         $this->renderPage();
         return;
     }
     // renders the master page
     ob_start();
     $this->masterPage->show();
     $masterPageRendered = ob_get_clean();
     /* @var $qpMasterPage \QueryPath\DOMQuery */
     $qpMasterPage = qp($masterPageRendered);
     // renders the current page
     $pageRendered = $this->getOutput();
     $qpPage = qp($pageRendered);
     // assemblies the master page and current page
     foreach ($this->masterPageParts as $masterPagePart) {
         $masterPagePlaceholderId = '#' . $masterPagePart[MAbstractPageController::MASTER_PAGE_PLACEHOLDER_ID];
         $pageContentId = '#' . $masterPagePart[MAbstractPageController::PAGE_CONTENT_ID];
         $qpMasterPage->find($masterPagePlaceholderId)->html($qpPage->find($pageContentId)->innerHtml());
     }
     $this->setOutput($qpMasterPage->html());
     $this->renderPage();
 }
Example #3
0
 public function __construct(MAbstractViewController $parent = null)
 {
     parent::__construct(__DIR__ . '/MRepeaterView.php', $parent);
 }