Пример #1
0
 protected function _getToken($uri)
 {
     $config = Mvc::getConfig();
     // Have we a URI?
     if ($uri) {
         // Is a landing template?
         if (preg_match('/^(.*)\\.html$/', $uri, $M)) {
             // Translate URI to get the right template
             //return $this->_getLandingToken( __URL($M[1]) );
             $i18n = new I18n();
             return $this->_getLandingToken($i18n->untranslateUrl($M[1]));
         }
         // ...else it should be a token
         return $uri;
     }
     // Check home.landing (template)
     if ($template = $config->getData('home.landing')) {
         return $this->_getLandingToken($template);
     }
     // Check home.token (controller/action)
     if ($token = $config->getData('home.token')) {
         return $token;
     }
     return 'index/index';
 }