Example #1
0
 /**
  * Return url without suffix
  *
  * @param string $key
  * @return string
  */
 protected function trimSuffix($key)
 {
     $suffix = $this->config->getCategoryUrlSuffix();
     //user can enter .html or html suffix
     if ($suffix != '' && $suffix[0] != '.') {
         $suffix = '.' . $suffix;
     }
     $key = str_replace($suffix, '', $key);
     $suffix = $this->config->getPostUrlSuffix();
     //user can enter .html or html suffix
     if ($suffix != '' && $suffix[0] != '.') {
         $suffix = '.' . $suffix;
     }
     $key = str_replace($suffix, '', $key);
     return $key;
 }