oncode of Craft CMS
3/2/2017 - 9:21 AM

Back button for entries to a previous specified view

Back button for entries to a previous specified view

  public function getBackUrl($referer, $defaultBackUrl)
  {
      if(strpos($referer, $defaultBackUrl) === false) {
          return $defaultBackUrl;
      }

      return $referer;
  }