Example #1
0
 /**
  * beforeRender
  * 
  * @return void
  * @access public
  */
 function beforeRender()
 {
     if (isset($this->params['pass'][0])) {
         // TODO ページ機能が.html拡張子なしに統合できたらコメントアウトされたものに切り替える
         //$this->data = $this->Page->findByUrl('/'.impload('/',$this->params['pass'][0]));
         $param = Configure::read('Baser.urlParam');
         if ($param && preg_match('/\\/$/is', $param)) {
             $param .= 'index';
         }
         if (Configure::read('AgentPrefix.on')) {
             $param = Configure::read('AgentPrefix.currentPrefix') . '/' . $param;
         }
         $this->data = $this->Page->findByUrl('/' . $param);
     }
 }
Example #2
0
 /**
  * beforeRender
  * 
  * @param string $viewFile (継承もとで利用中) The view file that is going to be rendered
  * @return void
  */
 public function beforeRender($viewFile)
 {
     //if ($this->request->params['controller'] == 'pages' && ($this->request->params['action'] == 'display' || $this->request->params['action'] == 'smartphone_display') && isset($this->request->params['pass'][0])) {
     if ($this->request->params['controller'] == 'pages' && preg_match('/(^|_)display$/', $this->request->params['action']) && isset($this->request->params['pass'][0])) {
         // @TODO ページ機能が.html拡張子なしに統合できたらコメントアウトされたものに切り替える
         //$this->request->data = $this->Page->findByUrl('/'.impload('/',$this->request->params['pass'][0]));
         $param = Configure::read('BcRequest.pureUrl');
         if ($param && preg_match('/\\/$/is', $param)) {
             $param .= 'index';
         }
         if (Configure::read('BcRequest.agent')) {
             $agentPrefix = Configure::read('BcRequest.agentPrefix');
             if (empty($this->BcBaser->siteConfig['linked_pages_' . $agentPrefix])) {
                 $param = $agentPrefix . '/' . $param;
             }
         }
         $param = preg_replace("/\\.html\$/", '', $param);
         $this->request->data = $this->Page->findByUrl('/' . $param);
     }
 }