dmBridge PHP API
DMInternalView.php
00001 <?php
00002 #
00003 # dmBridge: a data access framework for CONTENTdm(R)
00004 #
00005 # Copyright © 2009, 2010, 2011 Board of Regents of the Nevada System of Higher
00006 # Education, on behalf of the University of Nevada, Las Vegas
00007 #
00008 
00021 abstract class DMInternalView extends DMAbstractView {
00022 
00026    private $template;
00027 
00032    public function __construct(DMTemplate $template, DMSession $session) {
00033       parent::__construct($session);
00034       $this->setTemplate($template);
00035       $this->setHelper(new DMGenericTemplateHelper($this, $session));
00036    }
00037 
00041    public function render() {
00042       include_once($this->getTemplate()->getAbsolutePathname());
00043    }
00044 
00054    public function getFlash() {
00055       $flash = $this->getSession()->getFlash();
00056       if (!$flash instanceof DMFlash) {
00057          return false;
00058       }
00059       $msg = $flash->getValue();
00060       $this->getSession()->unsetFlash();
00061       return DMString::websafe($msg);
00062    }
00063 
00069    public function isFlash() {
00070       return ($this->getSession()->getFlash() instanceof DMFlash);
00071    }
00072 
00077    public function getTemplate() {
00078       return $this->template;
00079    }
00080 
00084    public function setTemplate(DMTemplate $template) {
00085       $this->template = $template;
00086    }
00087 
00088 }
 All Data Structures Functions Variables