/**
  * Translate Page class to Module and Page ID
  * 
  * @see pageClass2ModuleAndClass()
  *
  * @param string $inPageClass
  *
  * @return array (module, page_id)
  */
 public function pageClass2ModuleAndPageID($inPageClass)
 {
     list($module, $theClass) = $this->pageClass2ModuleAndClass($inPageClass);
     if ($theClass) {
         $pageID = Translator::getPageIDFromPageClassName($inPageClass, $this->getPageClassPrefix(), $this->getPageSearchPaths());
         return array($module, $pageID);
     }
     return array(null, null);
 }
Exemple #2
0
 /**
  * Returns leaf name of Page class
  * 
  * @return string
  */
 public function getPageClassName()
 {
     return Translator::getPageClassName($this, $this->getModule()->getPageSearchPaths());
 }
Exemple #3
0
 /**
  * Assemble a URL
  * 
  * @param RequestContext $inRequest
  * @param string $inPageClassName
  * @param string $inPagePathInfo
  * @param string $inInstanceID
  * @param string $inMutable
  * 
  * @throws \Exception
  * 
  * @return string the assembled URL
  */
 public function assembleURL(RequestContext $inRequest, $inPageClassName, $inPagePathInfo, $inInstanceID = null, $inMutable = true)
 {
     $fullClass = $this->resolvePageClass($inPageClassName);
     $pageID = Translator::getPageIDFromPageClassName($fullClass, $this->getPageClassPrefix(), $this->getPageSearchPaths());
     if (empty($pageID)) {
         throw new \Exception("Unable to create URL for page class: {$inPageClassName} [MODULE ID: {$this->getID()}]");
     }
     $result = $this->dispatchURL . "/{$pageID}";
     if (!empty($inPagePathInfo)) {
         $sep = $inMutable ? "/@" : "/!";
         if ($inInstanceID) {
             $sep .= $inInstanceID;
         }
         $result .= "{$sep}/{$inPagePathInfo}";
     }
     return $result;
 }